Class: Sportradar::Api::Basketball::Nba::Conference
- Defined in:
- lib/sportradar/api/basketball/nba/conference.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#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
- #divisions ⇒ Object
-
#initialize(data, **opts) ⇒ Conference
constructor
A new instance of Conference.
- #update(data, **opts) ⇒ 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) ⇒ Conference
Returns a new instance of Conference.
8 9 10 11 12 13 14 15 |
# File 'lib/sportradar/api/basketball/nba/conference.rb', line 8 def initialize(data, **opts) @response = data @api = opts[:api] @divisions_hash = {} update(data, **opts) end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/conference.rb', line 6 def alias @alias end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/conference.rb', line 6 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/conference.rb', line 6 def name @name end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/sportradar/api/basketball/nba/conference.rb', line 6 def response @response end |
Instance Method Details
#divisions ⇒ Object
25 26 27 |
# File 'lib/sportradar/api/basketball/nba/conference.rb', line 25 def divisions @divisions_hash.values end |
#update(data, **opts) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/sportradar/api/basketball/nba/conference.rb', line 17 def update(data, **opts) @id = data["id"] @name = data["name"] @alias = data["alias"] create_data(@divisions_hash, data["divisions"], klass: Division, conference: self, api: @api) if response["divisions"] end |