Module Prime::OldCompatibility
In: lib/backports/1.9.1/stdlib/prime.rb

Provides a Prime object with compatibility to Ruby 1.8 when instantiated via Prime.new.

Methods

each   next   succ  

Public Instance methods

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]

     # File lib/backports/1.9.1/stdlib/prime.rb, line 488
488:     def each(&block)
489:       return @generator.dup unless block_given?
490:       loop do
491:         yield succ
492:       end
493:     end
next()

Alias for succ

Returns the next prime number and forwards internal pointer.

[Source]

     # File lib/backports/1.9.1/stdlib/prime.rb, line 479
479:     def succ
480:       @generator.succ
481:     end

[Validate]