class AhlScraper::ElapsedTimeHelper

Attributes

time[R]

Public Class Methods

new(time) click to toggle source
# File lib/ahl_scraper/helpers/elapsed_time_helper.rb, line 7
def initialize(time)
  @time = time.to_i
end

Public Instance Methods

to_min()
Alias for: to_minutes
to_min_with_per()
to_minutes() click to toggle source
# File lib/ahl_scraper/helpers/elapsed_time_helper.rb, line 11
def to_minutes
  "#{time / 60}:#{(time % 60).to_s.rjust(2, '0')}"
end
Also aliased as: to_min
to_minutes_with_period() click to toggle source
# File lib/ahl_scraper/helpers/elapsed_time_helper.rb, line 15
def to_minutes_with_period
  period_elapsed = time % 1200

  ["#{period_elapsed / 60}:#{period_elapsed % 60}", (time / 1200) + 1]
end
Also aliased as: to_min_with_per