class NbaRb::Player::BaseClass

Attributes

data[RW]
first_name[RW]
last_name[RW]
only_current[RW]

Public Class Methods

new(*args) click to toggle source
Calls superclass method Initializable::new
# File lib/nba_rb/player.rb, line 36
def initialize(*args)
  super(*args)
  last_formatted = last_name.downcase.capitalize
  first_formatted = first_name.downcase.capitalize

  name = "#{last_formatted}, #{first_formatted}"
  list = PlayerList.new.info

  list['rowSet'].each do |player|
    @data = player if player[1] == name
  end
end

Public Instance Methods

id() click to toggle source
# File lib/nba_rb/player.rb, line 49
def id
  @data[0]
end
player_code() click to toggle source
# File lib/nba_rb/player.rb, line 53
def player_code
  @data[5]
end
rostered?() click to toggle source
# File lib/nba_rb/player.rb, line 57
def rostered?
  @data[2].zero?
end
team_abbreviation() click to toggle source
# File lib/nba_rb/player.rb, line 69
def team_abbreviation
  @data[9]
end
team_code() click to toggle source
# File lib/nba_rb/player.rb, line 73
def team_code
  @data[10]
end
team_id() click to toggle source
# File lib/nba_rb/player.rb, line 61
def team_id
  @data[6]
end
team_name() click to toggle source
# File lib/nba_rb/player.rb, line 65
def team_name
  @data[7] + ' ' + @data[8]
end