Class: SportsDataApi::Nfl::Player

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

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Player



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

def initialize(json)
  player_ivar = self.instance_variable_set("@player", {})
  self.class.class_eval { attr_reader :"player" }
  json.each_pair do | attr_name, attr_value|
    player_ivar[attr_name.to_sym] = attr_value
  end
end