Class: PrimeTime::PrimeTable

Inherits:
Table
  • Object
show all
Defined in:
lib/prime_time/prime_table.rb

Instance Attribute Summary collapse

Attributes inherited from Table

#col_headers, #height, #row_headers, #rows, #width

Instance Method Summary collapse

Methods inherited from Table

#to_s

Constructor Details

#initialize(n) ⇒ PrimeTable

Returns a new instance of PrimeTable.



5
6
7
8
9
# File 'lib/prime_time/prime_table.rb', line 5

def initialize(n)
  @primes = PrimeTime::Calculate.primes(n)
  super(width: n, height: n)
  build_table
end

Instance Attribute Details

#primesObject

Returns the value of attribute primes.



3
4
5
# File 'lib/prime_time/prime_table.rb', line 3

def primes
  @primes
end