Module: PrimeLib::Decorator::Table
- Included in:
- Generator
- Defined in:
- lib/prime_lib/decorator/table.rb
Instance Method Summary collapse
Instance Method Details
#lister ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/prime_lib/decorator/table.rb', line 11 def lister primes = [] each_with_index do |i, prime| primes << [i, prime.to_i] end primes end |
#lister_keys ⇒ Object
7 8 9 |
# File 'lib/prime_lib/decorator/table.rb', line 7 def lister_keys %W(i Prime) end |
#to_table ⇒ Object
19 20 21 |
# File 'lib/prime_lib/decorator/table.rb', line 19 def to_table ::Terminal::Table.new :headings => lister_keys, :rows => lister end |