Class: Architect::Edge
- Inherits:
-
Object
- Object
- Architect::Edge
- Defined in:
- lib/architect/edge.rb
Overview
This is a generic edge in a graph which connects two nodes
Direct Known Subclasses
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(node1, node2) ⇒ Edge
constructor
A new instance of Edge.
Constructor Details
#initialize(node1, node2) ⇒ Edge
Returns a new instance of Edge.
9 10 11 12 13 14 |
# File 'lib/architect/edge.rb', line 9 def initialize(node1, node2) raise node1.to_s + " must be a Node" unless node1.kind_of? Node raise node2.to_s + " must be a Node" unless node2.kind_of? Node @node1 = node1 @node2 = node2 end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
7 8 9 |
# File 'lib/architect/edge.rb', line 7 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
7 8 9 |
# File 'lib/architect/edge.rb', line 7 def to @to end |