Sha256: ea586e776dee71eaa8b22987ded0d40b647714a8309278662632e70e26a0fca3

Contents?: true

Size: 458 Bytes

Versions: 30

Compression:

Stored size: 458 Bytes

Contents

module Runby
  # Base class for ranges of Runby data, e.g. PaceRange, SpeedRange, ...
  class RunbyRange
    attr_reader :fast, :slow

    def initialize
      @fast = nil
      @slow = nil
      raise 'RunbyRange is a base class for PaceRange and SpeedRange. Instantiate one of them instead.'
    end

    def to_s(format: :short)
      if @fast == @slow
        @fast.to_s(format: format)
      else
        "#{@fast}-#{@slow}"
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
runby_pace-0.6.143 lib/runby_pace/runby_range.rb
runby_pace-0.6.142 lib/runby_pace/runby_range.rb
runby_pace-0.6.141 lib/runby_pace/runby_range.rb
runby_pace-0.6.140 lib/runby_pace/runby_range.rb
runby_pace-0.6.139 lib/runby_pace/runby_range.rb
runby_pace-0.6.137 lib/runby_pace/runby_range.rb
runby_pace-0.6.136 lib/runby_pace/runby_range.rb
runby_pace-0.6.133 lib/runby_pace/runby_range.rb
runby_pace-0.6.132 lib/runby_pace/runby_range.rb
runby_pace-0.6.131 lib/runby_pace/runby_range.rb
runby_pace-0.6.130 lib/runby_pace/runby_range.rb
runby_pace-0.6.128 lib/runby_pace/runby_range.rb
runby_pace-0.6.127 lib/runby_pace/runby_range.rb
runby_pace-0.6.126 lib/runby_pace/runby_range.rb
runby_pace-0.6.125 lib/runby_pace/runby_range.rb
runby_pace-0.6.124 lib/runby_pace/runby_range.rb
runby_pace-0.6.123 lib/runby_pace/runby_range.rb
runby_pace-0.6.122 lib/runby_pace/runby_range.rb
runby_pace-0.6.121 lib/runby_pace/runby_range.rb
runby_pace-0.6.120 lib/runby_pace/runby_range.rb