Module | Prime::OldCompatibility |
In: |
lib/backports/1.9.1/stdlib/prime.rb
|
Overwrites Prime#each.
Iterates the given block over all prime numbers. Note that enumeration starts from the current position of internal pointer, not rewound.
# 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