Provides a Prime object with compatibility to Ruby 1.8 when
instantiated via Prime.new.
Methods
Instance Public methods
each(&block)
Link
Overwrites Prime#each.
Iterates the given block over all prime numbers. Note that enumeration starts from the current position of internal pointer, not rewound.
Source: show
# File lib/prime.rb, line 483 def each(&block) return @generator.dup unless block_given? loop do yield succ end end