Class: Pairity::Edge

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(weight: 0, days: 0, resistance: 1) ⇒ Edge

Returns a new instance of Edge.



6
7
8
9
10
# File 'lib/pairity/edge.rb', line 6

def initialize(weight: 0, days: 0, resistance: 1)
  @weight = weight
  @days = days
  @resistance = resistance
end

Instance Attribute Details

#daysObject

Returns the value of attribute days.



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

def days
  @days
end

#resistanceObject

Returns the value of attribute resistance.



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

def resistance
  @resistance
end

#weightObject

Returns the value of attribute weight.



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

def weight
  @weight
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/pairity/edge.rb', line 12

def to_s
  "Weight: #{weight} Days: #{days}"
end