Class: DirectedGraph::Edge
- Inherits:
-
Object
- Object
- DirectedGraph::Edge
- Defined in:
- lib/directed_graph/edge.rb
Instance Attribute Summary collapse
-
#destination_vertex ⇒ Object
readonly
Returns the value of attribute destination_vertex.
-
#origin_vertex ⇒ Object
readonly
Returns the value of attribute origin_vertex.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(args) ⇒ Edge
constructor
A new instance of Edge.
Constructor Details
#initialize(args) ⇒ Edge
Returns a new instance of Edge.
7 8 9 10 11 |
# File 'lib/directed_graph/edge.rb', line 7 def initialize(args) @origin_vertex = args.fetch(:origin_vertex) @destination_vertex = args.fetch(:destination_vertex) @value = args.fetch(:value, nil) end |
Instance Attribute Details
#destination_vertex ⇒ Object (readonly)
Returns the value of attribute destination_vertex.
5 6 7 |
# File 'lib/directed_graph/edge.rb', line 5 def destination_vertex @destination_vertex end |
#origin_vertex ⇒ Object (readonly)
Returns the value of attribute origin_vertex.
5 6 7 |
# File 'lib/directed_graph/edge.rb', line 5 def origin_vertex @origin_vertex end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/directed_graph/edge.rb', line 5 def value @value end |