Class: NetworkElement
- Inherits:
-
Object
- Object
- NetworkElement
- Includes:
- SerializeBehavior
- Defined in:
- lib/network_entities/abstracts/network_element.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#in_elements ⇒ Object
readonly
Returns the value of attribute in_elements.
-
#my_number ⇒ Object
readonly
Returns the value of attribute my_number.
-
#out_elements ⇒ Object
readonly
Returns the value of attribute out_elements.
Instance Method Summary collapse
- #increase_quantity_in_one ⇒ Object
-
#initialize(id) ⇒ NetworkElement
constructor
A new instance of NetworkElement.
Methods included from SerializeBehavior
#transform_to_output_representation, #validate_concrete_builder
Constructor Details
#initialize(id) ⇒ NetworkElement
8 9 10 11 12 13 |
# File 'lib/network_entities/abstracts/network_element.rb', line 8 def initialize(id) @my_number = self.increase_quantity_in_one @id = id @out_elements = [] @in_elements = [] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/network_entities/abstracts/network_element.rb', line 6 def id @id end |
#in_elements ⇒ Object (readonly)
Returns the value of attribute in_elements.
6 7 8 |
# File 'lib/network_entities/abstracts/network_element.rb', line 6 def in_elements @in_elements end |
#my_number ⇒ Object (readonly)
Returns the value of attribute my_number.
6 7 8 |
# File 'lib/network_entities/abstracts/network_element.rb', line 6 def my_number @my_number end |
#out_elements ⇒ Object (readonly)
Returns the value of attribute out_elements.
6 7 8 |
# File 'lib/network_entities/abstracts/network_element.rb', line 6 def out_elements @out_elements end |
Instance Method Details
#increase_quantity_in_one ⇒ Object
15 16 17 18 |
# File 'lib/network_entities/abstracts/network_element.rb', line 15 def increase_quantity_in_one @@quantity ||= 0 @@quantity += 1 end |