Class: DFuzz::Fudge
- Defined in:
- lib/dfuzz/fudge.rb
Overview
Generate Xi-F…Xi+F for each Xi in boundaries and fudge_factor F
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(boundaries, fudge_factor, mask = nil) ⇒ Fudge
constructor
A new instance of Fudge.
Methods inherited from Generator
#current, #each, #empty?, #end?, #index, #next, #next?, #pos, #rewind, #shift, #yield
Constructor Details
#initialize(boundaries, fudge_factor, mask = nil) ⇒ Fudge
Returns a new instance of Fudge.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dfuzz/fudge.rb', line 6 def initialize(boundaries, fudge_factor, mask = nil) super() { |g| boundaries.each {|b| 0.upto(fudge_factor) { |f| if (mask) g.yield((b+f) & mask) g.yield((b-f) & mask) else g.yield b+f g.yield b-f end } } } end |