Class: Sportradar::Nhl::Models::ScoringPlayer
Instance Method Summary
collapse
#clock, #description, #event, #event_id, #full_name, #goal?, #initialize, #jersey, #penalty?, #period, #period_abbreviation, #period_number, #period_sequence, #period_type, #player, #player_id, #saved?, #shootout?, #stat, #strength, #team, #team_id, #team_market, #team_name, #type, #win?, #zone
Instance Method Details
#role ⇒ Object
5
6
7
8
9
10
11
12
13
|
# File 'lib/sportradar/nhl/models/scoring_player.rb', line 5
def role
if goal? && type == 'shot'
'scorer'
elsif goal? && type == 'shotagainst' && !saved?
'goalie'
else
type
end
end
|
#scoring_play_id ⇒ Object
15
16
17
|
# File 'lib/sportradar/nhl/models/scoring_player.rb', line 15
def scoring_play_id
event.id
end
|
#to_s ⇒ Object
19
20
21
|
# File 'lib/sportradar/nhl/models/scoring_player.rb', line 19
def to_s
"#{super} - #{role}"
end
|