Class: Edge
- Inherits:
-
Object
- Object
- Edge
- Defined in:
- lib/edge.rb
Instance Attribute Summary collapse
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
Instance Attribute Details
#cost ⇒ Object
Returns the value of attribute cost.
2 3 4 |
# File 'lib/edge.rb', line 2 def cost @cost end |
#from ⇒ Object
Returns the value of attribute from.
2 3 4 |
# File 'lib/edge.rb', line 2 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
2 3 4 |
# File 'lib/edge.rb', line 2 def to @to end |
Instance Method Details
#to_s ⇒ Object
4 5 6 |
# File 'lib/edge.rb', line 4 def to_s "Edge #{from} -> #{to} (costs #{cost})" end |