class RBT::Cookbooks::ReportTheRegisteredPrograms

Constants

SHOW_CLASS_NAME
#

SHOW_CLASS_NAME

#

Public Class Methods

new( commandline_arguments = ARGV, run_already = true ) { || ... } click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/report_the_registered_programs.rb, line 40
def initialize(
    commandline_arguments = ARGV,
    run_already           = true
  )
  reset
  if commandline_arguments
    unless commandline_arguments.empty?
      case commandline_arguments.first # Use --short if you want to have a shorter variant instead.
      when 'do_not_show_the_class_name','--short'
        @show_class_name = false
      end
    end
  end
  # ======================================================================= #
  # === Handle blocks next
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    when :short
      @show_class_name = false
    end
  end
  run if run_already
end

Public Instance Methods

do_report_how_many_programs_are_registered() click to toggle source
#

do_report_how_many_programs_are_registered

#
# File lib/rbt/utility_scripts/report_the_registered_programs.rb, line 88
def do_report_how_many_programs_are_registered
  opnn if show_class_name?
  e "#{sfancy(RBT.n_programs_available?)} programs are "\
    "registered in the #{orange('RBT project')} as of "\
    "#{cadetblue(return_date)}."
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/report_the_registered_programs.rb, line 69
def reset
  super()
  infer_the_namespace
  # ======================================================================= #
  # === @show_class_name
  # ======================================================================= #
  @show_class_name = SHOW_CLASS_NAME
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/report_the_registered_programs.rb, line 98
def run
  do_report_how_many_programs_are_registered
end
show_class_name?() click to toggle source
#

show_class_name?

#
# File lib/rbt/utility_scripts/report_the_registered_programs.rb, line 81
def show_class_name?
  @show_class_name
end