Sha256: 0bc3d96743ab41057d9688a4b3b0edc949a464fd13a190357112d15f70643562

Contents?: true

Size: 372 Bytes

Versions: 10

Compression:

Stored size: 372 Bytes

Contents

module Runby
  # Represents a pace consisting of a distance and a time in which that distance was covered
  class Pace
    attr_reader :time, :distance
    def initialize(time, distance = '1K')
      @time = Runby::RunbyTime.parse(time)
      @distance = Runby::Distance.new(distance)
    end

    def to_s
      "#{time} per #{distance.pluralized_uom}"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
runby_pace-0.6.90 lib/runby_pace/pace.rb
runby_pace-0.6.89 lib/runby_pace/pace.rb
runby_pace-0.6.88 lib/runby_pace/pace.rb
runby_pace-0.6.87 lib/runby_pace/pace.rb
runby_pace-0.5.86 lib/runby_pace/pace.rb
runby_pace-0.5.85 lib/runby_pace/pace.rb
runby_pace-0.4.84 lib/runby_pace/pace.rb
runby_pace-0.4.83 lib/runby_pace/pace.rb
runby_pace-0.4.82 lib/runby_pace/pace.rb
runby_pace-0.4.81 lib/runby_pace/pace.rb