Class: Poolelement
- Inherits:
-
Object
- Object
- Poolelement
- Defined in:
- lib/pkm_level2_converter/types.rb
Overview
Generische Klasse Poolelement
Direct Known Subclasses
Class Attribute Summary collapse
-
.all_instances ⇒ Object
readonly
Returns the value of attribute all_instances.
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key, index) ⇒ Poolelement
constructor
A new instance of Poolelement.
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_instances ⇒ Object (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
#key ⇒ Object (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 |