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