Class: Wallace::Koza::NonTerminalSet

Inherits:
NodeValueSet show all
Defined in:
lib/modules/koza/koza_node_value_set.rb

Overview

Holds the set of non-terminal values.

Instance Method Summary collapse

Methods inherited from NodeValueSet

#[], #initialize

Constructor Details

This class inherits a constructor from Wallace::Koza::NodeValueSet

Instance Method Details

#sample(opts = {}) ⇒ Object

Samples an option from this set.

Parameters:

  • opt, a hash of keyword options for this method. -> random, the RNG to use to sample an option.



47
48
49
# File 'lib/modules/koza/koza_node_value_set.rb', line 47

def sample(opts = {})
  @contents.sample(random: opts[:random] || Random.new)
end