Class: Poolelement

Inherits:
Object
  • Object
show all
Defined in:
lib/pkm_level2_converter/types.rb

Overview

Generische Klasse Poolelement

Direct Known Subclasses

Ausgangsparameter, Ausgangsschnittstelle, Sprache

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, index) ⇒ Poolelement

Returns a new instance of Poolelement.



17
18
19
20
# File 'lib/pkm_level2_converter/types.rb', line 17

def initialize(key, index)
  @key = key + index
  Poolelement.add(self)
end

Class Attribute Details

.all_instancesObject (readonly)

Returns the value of attribute all_instances.



14
15
16
# File 'lib/pkm_level2_converter/types.rb', line 14

def all_instances
  @all_instances
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



22
23
24
# File 'lib/pkm_level2_converter/types.rb', line 22

def key
  @key
end

Class Method Details

.add(instance) ⇒ Object



6
7
8
9
# File 'lib/pkm_level2_converter/types.rb', line 6

def add(instance)
  @all_instances ||= []
  @all_instances.push(instance)
end

.get_by_ref(ref) ⇒ Object



11
12
13
# File 'lib/pkm_level2_converter/types.rb', line 11

def get_by_ref(ref)
  @all_instances.find { |element| element.key == ref }
end