class IllBeBack::DebugStrategies::NTimes
Public Class Methods
from_enumerator(enumerator)
click to toggle source
# File lib/ill_be_back/debug_strategies/n_times.rb, line 5 def self.from_enumerator(enumerator) count = 0 enumerator.each { count += 1 } new(count) end
new(count)
click to toggle source
# File lib/ill_be_back/debug_strategies/n_times.rb, line 11 def initialize(count) @count = count end
Public Instance Methods
call(stops, block)
click to toggle source
# File lib/ill_be_back/debug_strategies/n_times.rb, line 15 def call(stops, block) block.call unless stops > @count end