Class: Tinydot::Node
- Inherits:
-
Object
- Object
- Tinydot::Node
- Defined in:
- lib/tinydot/node.rb
Instance Attribute Summary collapse
-
#edges ⇒ Object
readonly
Returns the value of attribute edges.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #>>(other) ⇒ Object
-
#initialize(name) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(name) ⇒ Node
Returns a new instance of Node.
5 6 7 8 |
# File 'lib/tinydot/node.rb', line 5 def initialize(name) @name = name @edges = [] end |
Instance Attribute Details
#edges ⇒ Object (readonly)
Returns the value of attribute edges.
3 4 5 |
# File 'lib/tinydot/node.rb', line 3 def edges @edges end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/tinydot/node.rb', line 3 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
15 16 17 18 |
# File 'lib/tinydot/node.rb', line 15 def <=>(other) @edges << Edge.new(self, other, dir: "both") other end |
#>>(other) ⇒ Object
10 11 12 13 |
# File 'lib/tinydot/node.rb', line 10 def >>(other) @edges << Edge.new(self, other) other end |