Class: Zadt::Edge

Inherits:
Object
  • Object
show all
Defined in:
lib/zadt/AbstractDataTypes/Graph/edge.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#connectionObject (readonly)

Made up of a



4
5
6
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 4

def connection
  @connection
end

#valueObject

Contains



6
7
8
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 6

def value
  @value
end

Class Method Details

.helpObject



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

.methodsObject



12
13
14
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 12

def self.methods
  self.help
end

Instance Method Details

#helpObject



21
22
23
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 21

def help
  self.help
end

#inspectObject



17
18
19
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 17

def inspect
  @connection.to_s
end

#methodsObject



25
26
27
# File 'lib/zadt/AbstractDataTypes/Graph/edge.rb', line 25

def methods
  help
end