Class: VGen::FloatGen
- Inherits:
-
Object
- Object
- VGen::FloatGen
- Defined in:
- lib/v_gen/float_gen.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(range = (-10..10)) ⇒ FloatGen
constructor
A new instance of FloatGen.
Constructor Details
#initialize(range = (-10..10)) ⇒ FloatGen
Returns a new instance of FloatGen.
3 4 5 6 7 |
# File 'lib/v_gen/float_gen.rb', line 3 def initialize( range=(-10..10) ) @range = range end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 |
# File 'lib/v_gen/float_gen.rb', line 9 def call() Random.new.rand( (@range.min.to_f..@range.max.to_f) ) end |