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.119 lib/runby_pace/runby_range.rb
runby_pace-0.6.118 lib/runby_pace/runby_range.rb
runby_pace-0.6.117 lib/runby_pace/runby_range.rb
runby_pace-0.6.116 lib/runby_pace/runby_range.rb
runby_pace-0.6.115 lib/runby_pace/runby_range.rb
runby_pace-0.6.114 lib/runby_pace/runby_range.rb
runby_pace-0.6.113 lib/runby_pace/runby_range.rb
runby_pace-0.6.112 lib/runby_pace/runby_range.rb
runby_pace-0.6.111 lib/runby_pace/runby_range.rb
runby_pace-0.6.110 lib/runby_pace/runby_range.rb