Class: AhlScraper::Games::Skater
- Inherits:
-
Resource
- Object
- Resource
- AhlScraper::Games::Skater
show all
- Defined in:
- lib/ahl_scraper/resources/games/skater.rb
Instance Method Summary
collapse
Methods inherited from Resource
#[], #each, #initialize, #inspect, #keys, #to_json, #values
Instance Method Details
#birthdate ⇒ Object
26
27
28
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 26
def birthdate
@birthdate ||= valid_birthdate? ? @raw_data[:birthdate] : nil
end
|
#captaincy ⇒ Object
46
47
48
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 46
def captaincy
@captaincy ||= @raw_data[:captaincy]
end
|
#current_age ⇒ Object
30
31
32
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 30
def current_age
@current_age ||= valid_birthdate? ? BirthdateHelper.new(birthdate).age_on_date(@opts[:game_date]) : nil
end
|
#first_name ⇒ Object
10
11
12
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 10
def first_name
@first_name ||= @raw_data[:first_name]
end
|
#home_team ⇒ Object
50
51
52
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 50
def home_team
@home_team ||= @raw_data[:home_team]
end
|
#id ⇒ Object
6
7
8
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 6
def id
@id ||= @raw_data[:id]
end
|
#jersey_number ⇒ Object
22
23
24
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 22
def jersey_number
@jersey_number ||= @raw_data[:number]
end
|
#last_name ⇒ Object
14
15
16
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 14
def last_name
@last_name ||= @raw_data[:last_name]
end
|
#on_ice ⇒ Object
71
72
73
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 71
def on_ice
@on_ice ||= @opts[:on_ice_statline]
end
|
#penalty ⇒ Object
75
76
77
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 75
def penalty
@penalty ||= @opts[:penalty_statline]
end
|
#penalty_shot ⇒ Object
79
80
81
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 79
def penalty_shot
@penalty_shot ||= @opts[:penalty_shot_statline] || {}
end
|
#position ⇒ Object
18
19
20
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 18
def position
@position ||= @raw_data[:position]
end
|
#scoring ⇒ Object
67
68
69
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 67
def scoring
@scoring ||= @opts[:scoring_statline]
end
|
#shootout ⇒ Object
83
84
85
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 83
def shootout
@shootout ||= @opts[:shootout_statline] || {}
end
|
#shots ⇒ Object
63
64
65
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 63
def shots
@shots ||= { sog_as: @raw_data[:sog_as] }
end
|
#starting ⇒ Object
42
43
44
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 42
def starting
@starting ||= @raw_data[:starting]
end
|
#stats ⇒ Object
54
55
56
57
58
59
60
61
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 54
def stats
@stats ||= {
faceoff_attempts: @raw_data[:faceoff_attempts],
faceoff_wins: @raw_data[:faceoff_wins],
hits: @raw_data[:hits],
penalty_minutes: @raw_data[:penalty_minutes],
}
end
|
#team_abbreviation ⇒ Object
38
39
40
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 38
def team_abbreviation
@team_abbreviation ||= @raw_data[:team_abbreviation]
end
|
#team_id ⇒ Object
34
35
36
|
# File 'lib/ahl_scraper/resources/games/skater.rb', line 34
def team_id
@team_id ||= @raw_data[:team_id]
end
|