Class: Steffi::Edge

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(graph, from, to) ⇒ Edge

Returns a new instance of Edge.



5
6
7
8
9
# File 'lib/steffi/edge.rb', line 5

def initialize graph,from,to
  @graph = graph
  @from = from
  @to = to
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/steffi/edge.rb', line 3

def from
  @from
end

#graphObject

Returns the value of attribute graph.



3
4
5
# File 'lib/steffi/edge.rb', line 3

def graph
  @graph
end

#toObject

Returns the value of attribute to.



3
4
5
# File 'lib/steffi/edge.rb', line 3

def to
  @to
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/steffi/edge.rb', line 11

def to_s
  "(#{from},#{to})"
end