Class: Edge

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#costObject

Returns the value of attribute cost.



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

def cost
  @cost
end

#fromObject

Returns the value of attribute from.



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

def from
  @from
end

#toObject

Returns the value of attribute to.



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

def to
  @to
end

Instance Method Details

#to_sObject



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

def to_s
  "Edge #{from} -> #{to} (costs #{cost})"
end