Sha256: 4312236a5978c5d5131f5ec94a24b51029a8aef94823b6656ce6778da160c5b2
Contents?: true
Size: 477 Bytes
Versions: 12
Compression:
Stored size: 477 Bytes
Contents
# frozen_string_literal: true module AhlScraper class ElapsedTimeHelper attr_reader :time def initialize(time) @time = time.to_i end def to_minutes "#{time / 60}:#{(time % 60).to_s.rjust(2, '0')}" end def to_minutes_with_period period_elapsed = time % 1200 ["#{period_elapsed / 60}:#{period_elapsed % 60}", (time / 1200) + 1] end alias to_min to_minutes alias to_min_with_per to_minutes_with_period end end
Version data entries
12 entries across 12 versions & 1 rubygems