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