Class: Sportradar::Api::Football::Nfl::TeamDepthChart
- Includes:
- Enumerable
- Defined in:
- lib/sportradar/api/football/nfl/team_depth_chart.rb
Instance Attribute Summary collapse
-
#abbrev ⇒ Object
Returns the value of attribute abbrev.
-
#response ⇒ Object
Returns the value of attribute response.
-
#season ⇒ Object
Returns the value of attribute season.
-
#team_id ⇒ Object
(also: #id)
Returns the value of attribute team_id.
Instance Method Summary collapse
- #defense ⇒ Object
- #each ⇒ Object
-
#initialize(data, **opts) ⇒ TeamDepthChart
constructor
data.keys => [“offense”, “defense”, “special_teams”, “name”, “market”, “alias”, “id”].
- #offense ⇒ Object
- #special_teams ⇒ 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) ⇒ TeamDepthChart
data.keys => [“offense”, “defense”, “special_teams”, “name”, “market”, “alias”, “id”]
11 12 13 14 15 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 11 def initialize(data, **opts) @response = data @team_id = data['id'] @abbrev = data['alias'] end |
Instance Attribute Details
#abbrev ⇒ Object
Returns the value of attribute abbrev.
7 8 9 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 7 def abbrev @abbrev end |
#response ⇒ Object
Returns the value of attribute response.
7 8 9 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 7 def response @response end |
#season ⇒ Object
Returns the value of attribute season.
7 8 9 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 7 def season @season end |
#team_id ⇒ Object Also known as: id
Returns the value of attribute team_id.
7 8 9 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 7 def team_id @team_id end |
Instance Method Details
#defense ⇒ Object
21 22 23 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 21 def defense @defense ||= DepthChart.new(response['defense']) if response['defense'] end |
#each ⇒ Object
29 30 31 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 29 def each [:offense, :defense, :special_teams].each { |type| yield type, send(type) } end |
#offense ⇒ Object
17 18 19 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 17 def offense @offense ||= DepthChart.new(response['offense']) if response['offense'] end |
#special_teams ⇒ Object
25 26 27 |
# File 'lib/sportradar/api/football/nfl/team_depth_chart.rb', line 25 def special_teams @special_teams ||= DepthChart.new(response['special_teams']) if response['special_teams'] end |