lib/rubyonacid/factories/constant.rb in rubyonacid-0.3.1 vs lib/rubyonacid/factories/constant.rb in rubyonacid-0.4.0
- old
+ new
@@ -10,12 +10,14 @@
def value=(value)
raise "assigned #{value} to value, must be between -1 and 1" if value < -1 or value > 1
@value = value
end
- def initialize(value = 0.5)
+ #Takes a hash with all keys supported by Factory, plus these keys and defaults:
+ # :value => 0.0
+ def initialize(options = {})
super
- @value = value
+ @value = options[:value] || 0.0
end
#Returns assigned value.
def get_unit(key)
@value
\ No newline at end of file