Class: Runby::Pace
- Inherits:
-
Object
- Object
- Runby::Pace
- Defined in:
- lib/runby_pace/pace.rb
Overview
Represents a pace consisting of a distance and a time in which that distance was covered
Instance Attribute Summary collapse
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time, distance = '1K') ⇒ Pace
constructor
A new instance of Pace.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
4 5 6 |
# File 'lib/runby_pace/pace.rb', line 4 def distance @distance end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
4 5 6 |
# File 'lib/runby_pace/pace.rb', line 4 def time @time end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/runby_pace/pace.rb', line 11 def to_s "#{time} per #{distance.pluralized_uom}" end |