# Each connection is handled by a Graph::Connection object, so that each end
# of the Edge can have it's own attributes.
class Edge < OpenStruct
- def initialize
- super
+ def initialize(values = {})
+ super(values)
self.connections = []
self
end
# Return the connection object that joins this Edge to the specified Vertex
def connection_at(vertex)
- self.connections.select {|c| c.end.equal? vertex}.first
+ self.connections.find {|c| c.end.equal? vertex}
end
end