Class: DirectedGraph::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/directed_graph/edge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_vertexObject (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_vertexObject (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

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/directed_graph/edge.rb', line 5

def value
  @value
end