Class: Sportradar::Api::Football::Nfl::DepthChart

Inherits:
Data
  • Object
show all
Includes:
Enumerable
Defined in:
lib/sportradar/api/football/nfl/depth_chart.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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) ⇒ DepthChart

Returns a new instance of DepthChart.



9
10
11
# File 'lib/sportradar/api/football/nfl/depth_chart.rb', line 9

def initialize(data)
  generate_chart(data)
end

Instance Attribute Details

#chartObject

Returns the value of attribute chart.



7
8
9
# File 'lib/sportradar/api/football/nfl/depth_chart.rb', line 7

def chart
  @chart
end

#responseObject

Returns the value of attribute response.



7
8
9
# File 'lib/sportradar/api/football/nfl/depth_chart.rb', line 7

def response
  @response
end

Instance Method Details

#eachObject



17
18
19
20
# File 'lib/sportradar/api/football/nfl/depth_chart.rb', line 17

def each
  populate_teams
  teams.each { |team| yield team }
end

#team(number) ⇒ Object



13
14
15
# File 'lib/sportradar/api/football/nfl/depth_chart.rb', line 13

def team(number)
  teams[number]
end