Class: PrintPrimesTable::Options::DefaultOption
- Inherits:
-
Object
- Object
- PrintPrimesTable::Options::DefaultOption
- Defined in:
- lib/print_primes_table/options/default_option.rb
Class Method Summary (collapse)
-
+ (Object) process(args)
procces the default option to print the table.
Class Method Details
+ (Object) process(args)
procces the default option to print the table. The validator print an error if there is an exception
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/print_primes_table/options/default_option.rb', line 10 def process(args) validator = Validators::DefaultValidator.validate(args) if validator == :valid if args.count>0 total = Integer(args[0]) primes = Primes.new total else primes= Primes.new end primes.print_table else puts validator end end |