Class: Zadt::Edge
- Inherits:
-
Object
- Object
- Zadt::Edge
- Defined in:
- lib/zadt/AbstractDataTypes/Graph/edge.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Made up of a.
-
#value ⇒ Object
Contains.
Class Method Summary collapse
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(v1, v2, value = Hash.new) ⇒ Edge
constructor
A new instance of Edge.
- #inspect ⇒ Object
- #methods ⇒ Object
Constructor Details
#initialize(v1, v2, value = Hash.new) ⇒ Edge
Returns a new instance of Edge.
7 8 9 10 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 7 def initialize(v1, v2, value = Hash.new) @connection = [v1, v2] @value = value end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Made up of a
4 5 6 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 4 def connection @connection end |
#value ⇒ Object
Contains
6 7 8 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 6 def value @value end |
Class Method Details
.help ⇒ Object
29 30 31 32 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 29 def self.help puts "Edge has one method:" puts "#connection, which returns the vertices the edge connects" end |
.methods ⇒ Object
12 13 14 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 12 def self.methods self.help end |
Instance Method Details
#help ⇒ Object
21 22 23 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 21 def help self.help end |
#inspect ⇒ Object
17 18 19 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 17 def inspect @connection.to_s end |
#methods ⇒ Object
25 26 27 |
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 25 def methods help end |