Class: AhlScraper::PlayoffBracket
- Inherits:
-
Resource
- Object
- Resource
- AhlScraper::PlayoffBracket
show all
- Defined in:
- lib/ahl_scraper/resources/playoff_bracket.rb
Instance Method Summary
collapse
Methods inherited from Resource
#[], #each, #inspect, #keys, #to_json, #values
Constructor Details
#initialize(raw_data, opts = {}) ⇒ PlayoffBracket
Returns a new instance of PlayoffBracket.
5
6
7
|
# File 'lib/ahl_scraper/resources/playoff_bracket.rb', line 5
def initialize(raw_data, opts = {})
super(raw_data, opts)
end
|
Instance Method Details
#logo_url ⇒ Object
17
18
19
|
# File 'lib/ahl_scraper/resources/playoff_bracket.rb', line 17
def logo_url
@logo_url ||= @raw_data[:logo]
end
|
#rounds ⇒ Object
13
14
15
|
# File 'lib/ahl_scraper/resources/playoff_bracket.rb', line 13
def rounds
@rounds ||= @raw_data[:rounds].map { |round| PlayoffBrackets::Round.new(round, { bracket_data: @raw_data }) }
end
|
#teams ⇒ Object
9
10
11
|
# File 'lib/ahl_scraper/resources/playoff_bracket.rb', line 9
def teams
@teams ||= @raw_data[:teams].map { |_team_id, team_data| PlayoffBrackets::Team.new(team_data) }
end
|