Class: Tensai::Pddl::NamedList

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/tensai/pddl/data_structures.rb

Overview

Typed collection of named elements

Instance Method Summary collapse

Constructor Details

#initialize(type, elements) ⇒ NamedList

Returns a new instance of NamedList.



15
16
17
18
# File 'lib/tensai/pddl/data_structures.rb', line 15

def initialize(type, elements)
  @type = DataTypes::Base.Instance(type)
  elements.each { |el| add el }
end

Instance Method Details

#eachObject



26
27
28
# File 'lib/tensai/pddl/data_structures.rb', line 26

def each
  elements.values.each { |el| yield el }
end