Class: Pairity::Edge
- Inherits:
-
Object
- Object
- Pairity::Edge
- Defined in:
- lib/pairity/edge.rb
Instance Attribute Summary collapse
-
#days ⇒ Object
Returns the value of attribute days.
-
#resistance ⇒ Object
Returns the value of attribute resistance.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(weight: 0, days: 0, resistance: 1) ⇒ Edge
constructor
A new instance of Edge.
- #to_s ⇒ Object
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
#days ⇒ Object
Returns the value of attribute days.
4 5 6 |
# File 'lib/pairity/edge.rb', line 4 def days @days end |
#resistance ⇒ Object
Returns the value of attribute resistance.
4 5 6 |
# File 'lib/pairity/edge.rb', line 4 def resistance @resistance end |
#weight ⇒ Object
Returns the value of attribute weight.
4 5 6 |
# File 'lib/pairity/edge.rb', line 4 def weight @weight end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/pairity/edge.rb', line 12 def to_s "Weight: #{weight} Days: #{days}" end |