Method: Chaser#mutate_value
- Defined in:
- lib/chaser.rb
#mutate_value(value) ⇒ Object
Replaces the value with a random value.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/chaser.rb', line 227 def mutate_value(value) case value when Fixnum, Float, Bignum value + rand_number when String rand_string when Symbol rand_symbol when Regexp Regexp.new(Regexp.escape(rand_string.gsub(/\//, '\\/'))) when Range rand_range when NilClass, FalseClass rand_number when TrueClass false else nil end end |