Class: AhlScraper::Games::ShootoutAttempt

Inherits:
Resource
  • Object
show all
Defined in:
lib/ahl_scraper/resources/games/shootout_attempt.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

#game_winner?Boolean

Returns:

  • (Boolean)


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

def game_winner?
  @game_winner ||= @raw_data[:isGameWinningGoal]
end

#goal?Boolean

Returns:

  • (Boolean)


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

def goal?
  @goal ||= @raw_data[:isGoal]
end

#goalieObject



28
29
30
31
32
33
34
35
36
# File 'lib/ahl_scraper/resources/games/shootout_attempt.rb', line 28

def goalie
  @goalie ||= {
    id: @raw_data[:goalie][:id],
    first_name: @raw_data[:goalie][:firstName],
    last_name: @raw_data[:goalie][:lastName],
    jersey_number: @raw_data[:goalie][:jerseyNumber],
    position: @raw_data[:goalie][:position],
  }
end

#goalie_teamObject



49
50
51
52
53
54
55
56
57
58
# File 'lib/ahl_scraper/resources/games/shootout_attempt.rb', line 49

def goalie_team
  @goalie_team ||= {
    id: @opts[:opposing_team].id,
    full_name: @opts[:opposing_team].name,
    city: @opts[:opposing_team].city,
    name: @opts[:opposing_team].name,
    abbreviation: @opts[:opposing_team].abbreviation,
    logo_url: @opts[:opposing_team].logo_url,
  }
end

#numberObject



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

def number
  @number ||= @opts[:number]
end

#shooterObject



18
19
20
21
22
23
24
25
26
# File 'lib/ahl_scraper/resources/games/shootout_attempt.rb', line 18

def shooter
  @shooter ||= {
    id: @raw_data[:shooter][:id],
    first_name: @raw_data[:shooter][:firstName],
    last_name: @raw_data[:shooter][:lastName],
    jersey_number: @raw_data[:shooter][:jerseyNumber],
    position: @raw_data[:shooter][:position],
  }
end

#shooting_teamObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/ahl_scraper/resources/games/shootout_attempt.rb', line 38

def shooting_team
  @shooting_team ||= {
    id: @raw_data[:shooterTeam][:id],
    full_name: @raw_data[:shooterTeam][:name],
    city: @raw_data[:shooterTeam][:city],
    name: @raw_data[:shooterTeam][:nickname],
    abbreviation: @raw_data[:shooterTeam][:abbreviation],
    logo_url: @raw_data[:shooterTeam][:logo],
  }
end