Class: ESPNFantasyNews::Player

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/espn_fantasy_news/player.rb', line 3

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



3
4
5
# File 'lib/espn_fantasy_news/player.rb', line 3

def position
  @position
end

#teamObject (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_sObject



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