Class: ESPNFantasyNews::Player
- Inherits:
-
Object
- Object
- ESPNFantasyNews::Player
- Defined in:
- lib/espn_fantasy_news/player.rb
Instance Attribute Summary collapse
-
#espn_player_id ⇒ Object
readonly
Returns the value of attribute espn_player_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#team ⇒ Object
readonly
Returns the value of attribute team.
Instance Method Summary collapse
-
#initialize(name, player_id, position, team) ⇒ Player
constructor
A new instance of Player.
- #to_s ⇒ Object
Constructor Details
#initialize(name, player_id, position, team) ⇒ Player
Returns a new instance of Player.
5 6 7 8 9 10 |
# File 'lib/espn_fantasy_news/player.rb', line 5 def initialize(name, player_id, position, team) @name = name @espn_player_id = player_id @position = position @team = team end |
Instance Attribute Details
#espn_player_id ⇒ Object (readonly)
Returns the value of attribute espn_player_id.
3 4 5 |
# File 'lib/espn_fantasy_news/player.rb', line 3 def espn_player_id @espn_player_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/espn_fantasy_news/player.rb', line 3 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
3 4 5 |
# File 'lib/espn_fantasy_news/player.rb', line 3 def position @position end |
#team ⇒ Object (readonly)
Returns the value of attribute team.
3 4 5 |
# File 'lib/espn_fantasy_news/player.rb', line 3 def team @team end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/espn_fantasy_news/player.rb', line 12 def to_s "#{self.name} - #{self.position} #{self.team}, id #{self.espn_player_id.to_s}" end |