class EmailGraph::UndirectedEdge

Attributes

vertices[R]

Public Class Methods

new(v, w) click to toggle source
# File lib/email_graph/undirected_graph.rb, line 46
def initialize(v, w)
  raise ArgumentError, "Vertices cannot be falsy" unless v && w
  @vertices = Set.new([v, w])
end

Public Instance Methods

==(other) click to toggle source
# File lib/email_graph/undirected_graph.rb, line 55
def ==(other)
  @vertices == other.vertices
end
Also aliased as: eql?
eql?(other)
Alias for: ==
hash() click to toggle source
# File lib/email_graph/undirected_graph.rb, line 51
def hash
  @vertices.hash
end
to_s() click to toggle source
# File lib/email_graph/undirected_graph.rb, line 60
def to_s
  a = @vertices.to_a
  "(#{a[0]}-#{a[1]})"
end