Class: SportsDataApi::Nfl::TeamRoster

Inherits:
Object
  • Object
show all
Defined in:
lib/sports_data_api/nfl/team_roster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ TeamRoster

Returns a new instance of TeamRoster.



6
7
8
9
10
# File 'lib/sports_data_api/nfl/team_roster.rb', line 6

def initialize(json)
  @players = json['players'].map do |player|
    Player.new(player)
  end
end

Instance Attribute Details

#playersObject (readonly)

Returns the value of attribute players.



4
5
6
# File 'lib/sports_data_api/nfl/team_roster.rb', line 4

def players
  @players
end