Class: AhlScraper::SkaterGameListItem

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

Instance Method Summary collapse

Methods inherited from Resource

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

Constructor Details

#initialize(raw_data, opts = {}) ⇒ SkaterGameListItem

Returns a new instance of SkaterGameListItem.



5
6
7
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 5

def initialize(raw_data, opts = {})
  super(raw_data, opts)
end

Instance Method Details

#assistsObject



49
50
51
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 49

def assists
  @assists ||= @raw_data[:row][:assists].to_i
end

#dateObject



17
18
19
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 17

def date
  @date ||= @raw_data[:row][:date_played]
end

#game_idObject



9
10
11
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 9

def game_id
  @game_id ||= @raw_data[:prop][:game][:gameLink].to_i
end

#game_nameObject



13
14
15
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 13

def game_name
  @game_name ||= @raw_data[:row][:game]
end

#game_winning_goalsObject



41
42
43
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 41

def game_winning_goals
  @game_winning_goals ||= @raw_data[:row][:gw].to_i
end

#goalsObject



25
26
27
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 25

def goals
  @goals ||= @raw_data[:row][:goals].to_i
end

#goals_ppObject



29
30
31
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 29

def goals_pp
  @goals_pp ||= @raw_data[:row][:pp].to_i
end

#goals_shObject



33
34
35
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 33

def goals_sh
  @goals_sh ||= @raw_data[:row][:sh].to_i
end

#penalty_minutesObject



61
62
63
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 61

def penalty_minutes
  @penalty_minutes ||= @raw_data[:row][:penalty_minutes].to_i
end

#plus_minusObject



45
46
47
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 45

def plus_minus
  @plus_minus ||= @raw_data[:row][:plusminus].to_i
end

#pointsObject



37
38
39
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 37

def points
  @points ||= @raw_data[:row][:points].to_i
end

#shootout_attemptsObject



57
58
59
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 57

def shootout_attempts
  @shootout_attempts ||= @raw_data[:row][:shootout_attempts].to_i
end

#shootout_goalsObject



53
54
55
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 53

def shootout_goals
  @shootout_goals ||= @raw_data[:row][:shootout_goals].to_i
end

#shotsObject



21
22
23
# File 'lib/ahl_scraper/resources/skater_game_list_item.rb', line 21

def shots
  @shots ||= @raw_data[:row][:shots].to_i
end