класс Prime::EratosthenesGenerator
Реализация PseudoPrimeGenerator.
Использует EratosthenesSieve.
Публичные методы класса
# File lib/prime.rb, line 309 def initialize @last_prime_index = -1 super end
Вызывает метод родительского класса Prime::PseudoPrimeGenerator.new
Публичные методы экземпляра
next()
Псевдоним для: succ
# File lib/prime.rb, line 318 def rewind initialize end
# File lib/prime.rb, line 314 def succ @last_prime_index += 1 EratosthenesSieve.instance.get_nth_prime(@last_prime_index) end
Также является псевдонимом для: next
Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.