Class: AhlScraper::TeamListItem
- Defined in:
- lib/ahl_scraper/resources/team_list_item.rb
Instance Attribute Summary collapse
-
#season_id ⇒ Object
readonly
Returns the value of attribute season_id.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(raw_data, season_id) ⇒ TeamListItem
constructor
A new instance of TeamListItem.
- #name ⇒ Object
Methods inherited from Resource
#[], #each, #inspect, #keys, #to_json, #values
Constructor Details
#initialize(raw_data, season_id) ⇒ TeamListItem
Returns a new instance of TeamListItem.
7 8 9 10 |
# File 'lib/ahl_scraper/resources/team_list_item.rb', line 7 def initialize(raw_data, season_id) super(raw_data, {}) @season_id = season_id end |
Instance Attribute Details
#season_id ⇒ Object (readonly)
Returns the value of attribute season_id.
5 6 7 |
# File 'lib/ahl_scraper/resources/team_list_item.rb', line 5 def season_id @season_id end |
Instance Method Details
#id ⇒ Object
16 17 18 |
# File 'lib/ahl_scraper/resources/team_list_item.rb', line 16 def id @id ||= @raw_data[:prop][:team_code][:teamLink].to_i end |
#name ⇒ Object
12 13 14 |
# File 'lib/ahl_scraper/resources/team_list_item.rb', line 12 def name @name ||= @raw_data[:row][:name] end |