class RBT::Action::Statistics::DisplayBarplotStatistics

Public Class Methods

[](i = ARGV) click to toggle source
#

RBT::Action::Statistics::DisplayBarplotStatistics[]

#
# File lib/rbt/actions/individual_actions/statistics/display_barplot_statistics.rb, line 62
def self.[](i = ARGV)
  new(i)
end
new( i = ARGV, run_already = true, &block ) click to toggle source
#

initialize

#
# File lib/rbt/actions/individual_actions/statistics/display_barplot_statistics.rb, line 29
def initialize(
    i           = ARGV,
    run_already = true,
    &block
  )
  reset
  set_commandline_arguments(i)
  run if run_already
end

Public Instance Methods

reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::Action#reset
# File lib/rbt/actions/individual_actions/statistics/display_barplot_statistics.rb, line 42
def reset
  super()
  infer_the_namespace
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/actions/individual_actions/statistics/display_barplot_statistics.rb, line 50
def run
  array = RBT.statistics?
  require 'unicode_plot'
  UnicodePlot.barplot(
    data: Hash[array], # {'foo': 20, 'bar': 50},
    title: 'RBT - increase in the number of programs over the years' 
  ).render
end