Class: Ogr::Edge
- Inherits:
-
Object
- Object
- Ogr::Edge
- Defined in:
- lib/ogr/graphs/edge.rb
Overview
Class implements graph edge
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(from, to, weight = 1) ⇒ Edge
constructor
Create new edge.
Constructor Details
#initialize(from, to, weight = 1) ⇒ Edge
Create new edge.
7 8 9 10 11 |
# File 'lib/ogr/graphs/edge.rb', line 7 def initialize(from, to, weight = 1) @from = from @to = to @weight = weight end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
4 5 6 |
# File 'lib/ogr/graphs/edge.rb', line 4 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
4 5 6 |
# File 'lib/ogr/graphs/edge.rb', line 4 def to @to end |
#weight ⇒ Object
Returns the value of attribute weight.
4 5 6 |
# File 'lib/ogr/graphs/edge.rb', line 4 def weight @weight end |