Class: Edge

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Edge

Returns a new instance of Edge.



4
5
6
# File 'lib/graph/edge.rb', line 4

def initialize type
  @type = type
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



2
3
4
# File 'lib/graph/edge.rb', line 2

def type
  @type
end

Instance Method Details

#eql?(object) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


8
9
10
# File 'lib/graph/edge.rb', line 8

def eql? object
  self.type.eql?(object.type)
end

#hashObject



13
14
15
# File 'lib/graph/edge.rb', line 13

def hash
  @type.hash
end

#to_sObject



17
18
19
# File 'lib/graph/edge.rb', line 17

def to_s
  @type
end