Class: VGen::WhateverGen
- Inherits:
-
Object
- Object
- VGen::WhateverGen
- Defined in:
- lib/v_gen/whatever_gen.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(gens: [ proc {Random.new.rand} ]) ⇒ WhateverGen
constructor
A new instance of WhateverGen.
Constructor Details
#initialize(gens: [ proc {Random.new.rand} ]) ⇒ WhateverGen
Returns a new instance of WhateverGen.
3 4 5 6 7 |
# File 'lib/v_gen/whatever_gen.rb', line 3 def initialize( gens: [ proc {Random.new.rand} ] ) @gens = gens end |
Instance Method Details
#call ⇒ Object
9 10 11 |
# File 'lib/v_gen/whatever_gen.rb', line 9 def call() @gens.sample.call end |