class FantasyFootball::Player

Attributes

age[RW]
college[RW]
height[RW]
name[RW]
position[RW]
projection[RW]
rank[RW]
team[RW]
url[RW]
week[RW]
weight[RW]

Public Class Methods

all() click to toggle source
# File lib/fantasy_football/player.rb, line 11
def self.all # Class variable reader
  @@all
end
find_by_position(position) click to toggle source
# File lib/fantasy_football/player.rb, line 19
def self.find_by_position(position)
  all.select {|i| i.position == position.upcase}.sort {|a,b| a.rank.to_i <=> b.rank.to_i}
end
find_by_rank_and_position(rank, position) click to toggle source
# File lib/fantasy_football/player.rb, line 23
def self.find_by_rank_and_position(rank, position)
  all.find {|i| i.rank == rank && i.position == position.upcase}
end
new() click to toggle source
# File lib/fantasy_football/player.rb, line 7
def initialize
  save
end

Public Instance Methods

save() click to toggle source
# File lib/fantasy_football/player.rb, line 15
def save
  @@all << self
end