Class: FundingPrimer::Prime::BaseGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/funding_primer/prime.rb

Direct Known Subclasses

PrimorialGenerator, TrialDivisionGenerator

Instance Method Summary collapse

Instance Method Details

#first(n) ⇒ Object

returns the first n primes in an array. For example:

first(3)
# => [2,3,5]

BaseGenerator#first(n) raises NotImplementedError.

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/funding_primer/prime.rb', line 19

def first(n)
  raise NotImplementedError, "need to define `succ'"
end