Class: AhlScraper::TeamListItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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

#idObject



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

#nameObject



12
13
14
# File 'lib/ahl_scraper/resources/team_list_item.rb', line 12

def name
  @name ||= @raw_data[:row][:name]
end