Class: PositionalGenerator::Builder::Oneof

Inherits:
Object
  • Object
show all
Defined in:
lib/helpers/positional_generator.rb

Defined Under Namespace

Classes: OneofSelector

Instance Method Summary collapse

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

#generateObject



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