Class: Sportradar::Api::Basketball::Nba::Schedule
- Defined in:
- lib/sportradar/api/basketball/nba/schedule.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#date ⇒ Object
Returns the value of attribute date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #games ⇒ Object
-
#initialize(data, **opts) ⇒ Schedule
constructor
A new instance of Schedule.
- #update_games(data) ⇒ Object
Methods inherited from Data
#all_attributes, #attributes, #create_data, #parse_into_array, #parse_into_array_with_options, #parse_out_hashes, #structure_links, #update_data
Constructor Details
#initialize(data, **opts) ⇒ Schedule
Returns a new instance of Schedule.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 8 def initialize(data, **opts) @response = data @api = opts[:api] # binding.pry # ['league'] @id = data.dig('league', 'id') @name = data.dig('league', 'name') @alias = data.dig('league', 'alias') @date = data.dig('date') @games_hash = {} update_games(data.dig('games')) end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 6 def alias @alias end |
#date ⇒ Object
Returns the value of attribute date.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 6 def date @date end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 6 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 6 def name @name end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 6 def response @response end |
Instance Method Details
#games ⇒ Object
23 24 25 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 23 def games @games_hash.values end |
#update_games(data) ⇒ Object
27 28 29 |
# File 'lib/sportradar/api/basketball/nba/schedule.rb', line 27 def update_games(data) create_data(@games_hash, data, klass: Game, api: @api, season: self) end |