Class: Ruckus::Mutator::Reset
- Defined in:
- lib/ruckus/mutator.rb
Overview
Cache the starting value (this is meant to the be first modifier in the chain, if you’re using it) and randomly reset the string back to that starting value.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Reset
constructor
A new instance of Reset.
- #mod(x) ⇒ Object
Methods inherited from Modifier
Constructor Details
#initialize(opts = {}) ⇒ Reset
Returns a new instance of Reset.
264 265 266 267 |
# File 'lib/ruckus/mutator.rb', line 264 def initialize(opts={}) opts[:prob] ||= 25 super(opts.merge(:now => true)) end |
Instance Method Details
#mod(x) ⇒ Object
269 270 271 |
# File 'lib/ruckus/mutator.rb', line 269 def mod(x) (@orig ||= x.clone).clone end |