Class: ESPNNBAFantasy::User
- Inherits:
-
Object
- Object
- ESPNNBAFantasy::User
- Defined in:
- lib/espn_nba_fantasy/user.rb
Instance Attribute Summary collapse
-
#add_team(team) ⇒ Object
Returns the value of attribute add_team.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#fantasy_id ⇒ Object
Returns the value of attribute fantasy_id.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#league ⇒ Object
Returns the value of attribute league.
-
#teams ⇒ Object
Returns the value of attribute teams.
Instance Method Summary collapse
-
#initialize(obj, league) ⇒ User
constructor
basic initialization with the various attributes.
-
#to_s ⇒ Object
returns data including the players trading away and receiving, your stats before and after the trade, and your change in stats for each category.
Constructor Details
#initialize(obj, league) ⇒ User
basic initialization with the various attributes
9 10 11 12 13 14 15 16 |
# File 'lib/espn_nba_fantasy/user.rb', line 9 def initialize(obj, league) @display_name = obj['displayName'] @first_name = obj['firstName'] @last_name = obj['lastName'] @fantasy_id = obj['id'] @teams = [] @league = league end |
Instance Attribute Details
#add_team(team) ⇒ Object
Returns the value of attribute add_team.
4 5 6 |
# File 'lib/espn_nba_fantasy/user.rb', line 4 def add_team @add_team end |
#display_name ⇒ Object
Returns the value of attribute display_name.
4 5 6 |
# File 'lib/espn_nba_fantasy/user.rb', line 4 def display_name @display_name end |
#fantasy_id ⇒ Object
Returns the value of attribute fantasy_id.
4 5 6 |
# File 'lib/espn_nba_fantasy/user.rb', line 4 def fantasy_id @fantasy_id end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/espn_nba_fantasy/user.rb', line 4 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/espn_nba_fantasy/user.rb', line 4 def last_name @last_name end |
#league ⇒ Object
Returns the value of attribute league.
4 5 6 |
# File 'lib/espn_nba_fantasy/user.rb', line 4 def league @league end |
#teams ⇒ Object
Returns the value of attribute teams.
4 5 6 |
# File 'lib/espn_nba_fantasy/user.rb', line 4 def teams @teams end |
Instance Method Details
#to_s ⇒ Object
returns data including the players trading away and receiving, your stats before and after the trade, and your change in stats for each category
24 25 26 |
# File 'lib/espn_nba_fantasy/user.rb', line 24 def to_s "User Name: #{first_name} #{last_name} | Teams: #{teams.map(&:name)}" end |