Class: PositionalGenerator::Builder::Oneof
- Inherits:
-
Object
- Object
- PositionalGenerator::Builder::Oneof
- Defined in:
- lib/helpers/positional_generator.rb
Defined Under Namespace
Classes: OneofSelector
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(builder, block) ⇒ Oneof
constructor
A new instance of Oneof.
Constructor Details
#initialize(builder, block) ⇒ Oneof
Returns a new instance of Oneof.
369 370 371 372 |
# File 'lib/helpers/positional_generator.rb', line 369 def initialize(builder, block) @block = block @builder = builder end |
Instance Method Details
#generate ⇒ Object
374 375 376 377 378 379 |
# File 'lib/helpers/positional_generator.rb', line 374 def generate(...) subgens = OneofSelector.new(@builder) @block.call(subgens) subgens.sample subgens.generate(...) end |