class AhlScraper::Games::Overtime

Public Instance Methods

away_goals() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 39
def away_goals
  @away_goals ||= @raw_data[:stats][:visitingGoals].to_i
end
away_sog() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 43
def away_sog
  @away_sog ||= @raw_data[:stats][:visitingShots].to_i
end
home_goals() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 31
def home_goals
  @home_goals ||= @raw_data[:stats][:homeGoals].to_i
end
home_sog() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 35
def home_sog
  @home_sog ||= @raw_data[:stats][:homeShots].to_i
end
length() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 14
def length
  @length ||= ElapsedTimeHelper.new(length_in_seconds).to_min
end
length_in_seconds() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 18
def length_in_seconds
  @length_in_seconds ||=
    if scoring?
      PeriodTimeHelper.new(@raw_data[:goals][0][:time]).to_sec
    else
      @opts[:regular_season] ? 300 : 1200
    end
end
name() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 10
def name
  @name ||= "#{@raw_data[:info][:longName]}#{number}"
end
number() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 6
def number
  @number ||= @raw_data[:info][:id].to_i - 3
end
scoring?() click to toggle source
# File lib/ahl_scraper/resources/games/overtime.rb, line 27
def scoring?
  @scoring ||= @raw_data[:goals].any?
end