Class: Variation::Change

Inherits:
Object
  • Object
show all
Defined in:
lib/variation/change.rb

Direct Known Subclasses

ImmediateChange, LinearChange, SigmoidChange

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hashed_args) ⇒ Change

Pass :length and :end_value by hash. Length must be > 0.



6
7
8
9
10
11
12
# File 'lib/variation/change.rb', line 6

def initialize hashed_args
  raise HashedArgMissingError unless hashed_args.has_key?(:length)
  raise HashedArgMissingError unless hashed_args.has_key?(:end_value)

  self.length = hashed_args[:length]
  self.end_value = hashed_args[:end_value]
end

Instance Attribute Details

#end_valueObject

Returns the value of attribute end_value.



3
4
5
# File 'lib/variation/change.rb', line 3

def end_value
  @end_value
end

#lengthObject

Returns the value of attribute length.



3
4
5
# File 'lib/variation/change.rb', line 3

def length
  @length
end