Class: Wallace::Koza::NodeValueSet

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

Overview

Used to hold terminal or non-terminal values.

Direct Known Subclasses

NonTerminalSet, TerminalSet

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ NodeValueSet

Constructs a new node value set.

Parameters:

  • contents, the contents of the set.



8
9
10
# File 'lib/modules/koza/koza_node_value_set.rb', line 8

def initialize(contents)
  @contents = contents
end

Instance Method Details

#[](index) ⇒ Object

Returns an option at a given index from the set.

Parameters:

  • index, the index of the option in the set.



16
17
18
# File 'lib/modules/koza/koza_node_value_set.rb', line 16

def [](index)
  @contents[index]
end