Class: AhlScraper::Games::Period

Inherits:
Resource
  • Object
show all
Defined in:
lib/ahl_scraper/resources/games/period.rb

Instance Method Summary collapse

Methods inherited from Resource

#[], #each, #initialize, #inspect, #keys, #to_json, #values

Constructor Details

This class inherits a constructor from AhlScraper::Resource

Instance Method Details

#away_goalsObject



22
23
24
# File 'lib/ahl_scraper/resources/games/period.rb', line 22

def away_goals
  @away_goals ||= @raw_data[:stats][:visitingGoals]
end

#away_sogObject



26
27
28
# File 'lib/ahl_scraper/resources/games/period.rb', line 26

def away_sog
  @away_sog ||= @raw_data[:stats][:visitingShots]
end

#home_goalsObject



14
15
16
# File 'lib/ahl_scraper/resources/games/period.rb', line 14

def home_goals
  @home_goals ||= @raw_data[:stats][:homeGoals]
end

#home_sogObject



18
19
20
# File 'lib/ahl_scraper/resources/games/period.rb', line 18

def home_sog
  @home_sog ||= @raw_data[:stats][:homeShots]
end

#nameObject



10
11
12
# File 'lib/ahl_scraper/resources/games/period.rb', line 10

def name
  @name ||= @raw_data[:info][:longName]
end

#numberObject



6
7
8
# File 'lib/ahl_scraper/resources/games/period.rb', line 6

def number
  @number ||= @raw_data[:info][:id].to_i
end