Class: Edge
- Inherits:
-
Object
- Object
- Edge
- Defined in:
- lib/graph/edge.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #eql?(object) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(type) ⇒ Edge
constructor
A new instance of Edge.
- #to_s ⇒ Object
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
#type ⇒ Object
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: ==
8 9 10 |
# File 'lib/graph/edge.rb', line 8 def eql? object self.type.eql?(object.type) end |
#hash ⇒ Object
13 14 15 |
# File 'lib/graph/edge.rb', line 13 def hash @type.hash end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/graph/edge.rb', line 17 def to_s @type end |