Class: AhlScraper::PlayoffBrackets::Round
- Inherits:
-
Resource
- Object
- Resource
- AhlScraper::PlayoffBrackets::Round
show all
- Defined in:
- lib/ahl_scraper/resources/playoff_brackets/round.rb
Instance Method Summary
collapse
Methods inherited from Resource
#[], #each, #initialize, #inspect, #keys, #to_json, #values
Instance Method Details
#active? ⇒ Boolean
35
36
37
38
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 35
def active?
@active = series.map(&:active?).any?(true) if @active.nil?
@active
end
|
#finished? ⇒ Boolean
40
41
42
43
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 40
def finished?
@finished = series.map(&:finished?).none?(false) && !active? if @finished.nil?
@finished
end
|
#id ⇒ Object
6
7
8
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 6
def id
@id ||= @raw_data[:round].to_i
end
|
#name ⇒ Object
10
11
12
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 10
def name
@name ||= @raw_data[:round_name]
end
|
#round_type_id ⇒ Object
18
19
20
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 18
def round_type_id
@round_type_id ||= @raw_data[:round_type_id].to_i
end
|
#round_type_name ⇒ Object
22
23
24
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 22
def round_type_name
@round_type_name ||= @raw_data[:round_type_name]
end
|
#season_id ⇒ Object
14
15
16
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 14
def season_id
@season_id ||= @raw_data[:season_id].to_i
end
|
#series ⇒ Object
26
27
28
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 26
def series
@series ||= @raw_data[:matchups].map { |series| Series.new(series, { bracket_data: @opts[:bracket_data] }) }
end
|
#started? ⇒ Boolean
30
31
32
33
|
# File 'lib/ahl_scraper/resources/playoff_brackets/round.rb', line 30
def started?
@started = active? || finished? if @started.nil?
@started
end
|