class AhlScraper::PeriodTimeHelper
Attributes
period[R]
time[R]
Public Class Methods
new(time, period = nil)
click to toggle source
# File lib/ahl_scraper/helpers/period_time_helper.rb, line 7 def initialize(time, period = nil) @time = time @period = period.to_i end
Public Instance Methods
to_period_seconds()
click to toggle source
# File lib/ahl_scraper/helpers/period_time_helper.rb, line 12 def to_period_seconds period_time = time.split(":") period_time[0].to_i * 60 + period_time[1].to_i end
Also aliased as: to_sec
to_time_elapsed()
click to toggle source
# File lib/ahl_scraper/helpers/period_time_helper.rb, line 17 def to_time_elapsed period_time = time.split(":") period_time[0].to_i * 60 + period_time[1].to_i + ((period - 1) * 1200) end
Also aliased as: to_elapsed