Sha256: 609c1b3e5b8b8eb2bb2ce7cdaa604d8f333edcf1846f2e6a1fba2a2eba2ca811

Contents?: true

Size: 489 Bytes

Versions: 23

Compression:

Stored size: 489 Bytes

Contents

# frozen_string_literal: true

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

23 entries across 23 versions & 1 rubygems

Version Path
runby_pace-0.62.7 lib/runby_pace/runby_range.rb
runby_pace-0.62.5 lib/runby_pace/runby_range.rb
runby_pace-0.62.4 lib/runby_pace/runby_range.rb
runby_pace-0.62.3 lib/runby_pace/runby_range.rb
runby_pace-0.62.2 lib/runby_pace/runby_range.rb
runby_pace-0.2.50.111 lib/runby_pace/runby_range.rb
runby_pace-0.61.160 lib/runby_pace/runby_range.rb
runby_pace-0.61.159 lib/runby_pace/runby_range.rb
runby_pace-0.61.158 lib/runby_pace/runby_range.rb
runby_pace-0.61.157 lib/runby_pace/runby_range.rb
runby_pace-0.61.156 lib/runby_pace/runby_range.rb
runby_pace-0.61.155 lib/runby_pace/runby_range.rb
runby_pace-0.61.154 lib/runby_pace/runby_range.rb
runby_pace-0.61.153 lib/runby_pace/runby_range.rb
runby_pace-0.6.152 lib/runby_pace/runby_range.rb
runby_pace-0.6.151 lib/runby_pace/runby_range.rb
runby_pace-0.6.150 lib/runby_pace/runby_range.rb
runby_pace-0.6.149 lib/runby_pace/runby_range.rb
runby_pace-0.6.148 lib/runby_pace/runby_range.rb
runby_pace-0.6.147 lib/runby_pace/runby_range.rb