Class: Sportradar::Api::Football::Ncaafb::Subdivision
- Defined in:
- lib/sportradar/api/football/ncaafb/subdivision.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
- #conferences ⇒ Object
-
#initialize(data, **opts) ⇒ Subdivision
constructor
A new instance of Subdivision.
- #team(code_name) ⇒ Object
- #teams ⇒ Object
- #teams=(array) ⇒ 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) ⇒ Subdivision
Returns a new instance of Subdivision.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 8 def initialize(data, **opts) @response = data @api = opts[:api] @id = data["id"] @name = data["name"] @teams_hash = {} @assigned_teams = nil # binding.pry create_data(@teams_hash, data["teams"], klass: Team, conference: self, api: @api) if data["teams"] end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
6 7 8 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 6 def alias @alias end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 6 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 6 def name @name end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 6 def response @response end |
Instance Method Details
#conferences ⇒ Object
34 35 36 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 34 def conferences teams.flat_map(&:conferences) end |
#team(code_name) ⇒ Object
28 29 30 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 28 def team(code_name) teams_by_name[code_name] end |
#teams ⇒ Object
22 23 24 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 22 def teams @assigned_teams || @teams_hash.values end |
#teams=(array) ⇒ Object
25 26 27 |
# File 'lib/sportradar/api/football/ncaafb/subdivision.rb', line 25 def teams=(array) @assigned_teams = array end |