Class: PrintPrimesTable::Options::HelpOption
- Inherits:
-
Object
- Object
- PrintPrimesTable::Options::HelpOption
- Defined in:
- lib/print_primes_table/options/help_option.rb
Overview
to handle the help messages output
Constant Summary
- MESSAGE =
{:headings=> ['Option','Description'], :rows => [ ["default\n\nwithout\noption" , <<EOF Print a table across the top and down the left side are the 10 primes, and the body of the table should contain the product of multiplying these numbers. This option accept one param the quantity. For example, if you want to print 20 type this print_table_primes 20 EOF ],[' ',' '], ["--only-primes" , <<EOF Print a list of 10 primes. This option accept one param the quantity. For example, if you want to print 20 type this print_table_primes --only-primes 20 EOF ],[' ',' '], ["--only-primes",'Print this help.'] ] }
Class Method Summary (collapse)
-
+ (Object) process(args, options)
process the –help option to show the options availables.
Class Method Details
+ (Object) process(args, options)
process the –help option to show the options availables.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/print_primes_table/options/help_option.rb', line 34 def process(args,) validator = Validators::HelpValidator.validate(args) if validator == :valid table = Terminal::Table.new :headings => MESSAGE[:headings], :rows => MESSAGE[:rows] puts table else puts validator end end |