Class: Wads::Edge
- Inherits:
-
Object
- Object
- Wads::Edge
- Defined in:
- lib/wads/data_structures.rb
Overview
An Edge is a connection between nodes that stores additional information as arbitrary tags, or name/value pairs.
Instance Attribute Summary collapse
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
- #add_tag(key, value) ⇒ Object
- #get_tag(key) ⇒ Object
-
#initialize(destination, tags = {}) ⇒ Edge
constructor
A new instance of Edge.
Constructor Details
#initialize(destination, tags = {}) ⇒ Edge
Returns a new instance of Edge.
458 459 460 461 |
# File 'lib/wads/data_structures.rb', line 458 def initialize(destination, = {}) @destination = destination @tags = end |
Instance Attribute Details
#destination ⇒ Object
Returns the value of attribute destination.
455 456 457 |
# File 'lib/wads/data_structures.rb', line 455 def destination @destination end |
#tags ⇒ Object
Returns the value of attribute tags.
456 457 458 |
# File 'lib/wads/data_structures.rb', line 456 def @tags end |
Instance Method Details
#add_tag(key, value) ⇒ Object
463 464 465 |
# File 'lib/wads/data_structures.rb', line 463 def add_tag(key, value) @tags[key] = value end |
#get_tag(key) ⇒ Object
467 468 469 |
# File 'lib/wads/data_structures.rb', line 467 def get_tag(key) @tags[key] end |