Class: Ruckus::Mutator::Adder

Inherits:
Modifier show all
Defined in:
lib/ruckus/mutator.rb

Overview

Adds fixed amounts of data.

A AA AAA AAAA … etc

Instance Method Summary collapse

Methods inherited from Modifier

#<<, #go?

Constructor Details

#initialize(opts = {}) ⇒ Adder

Takes:

base

(def: “A”) what to add

step

(def: 100) how much of this to add at each step



140
141
142
143
144
# File 'lib/ruckus/mutator.rb', line 140

def initialize(opts={})
    @base  = opts[:base] || "A"
    @step  = opts[:step]  || 100
    super
end

Instance Method Details

#mod(x) ⇒ Object



146
147
148
149
150
151
152
# File 'lib/ruckus/mutator.rb', line 146

def mod(x)
    if x.kind_of? String
        x + (@base * @step)
    else
        x + @step
    end
end