Sha256: 18eda83bba831fcff0a3cbf1bc700ab913f4e81f526ad81bcd03a46005ea3a32

Contents?: true

Size: 443 Bytes

Versions: 1

Compression:

Stored size: 443 Bytes

Contents

class  MlsStandings::Team
  attr_accessor :name, :games_played, :wins, :losses, :ties

  @@all = []

  def initialize(team_hash)
    team_hash.each_key{|k| self.send("#{k}=", team_hash[k])}
    @@all << self
  end

  def self.all
    @@all
  end

  def self.create_from_scrape(team)
    self.new(team)
  end

  def self.eastern_conf
    self.all[0..11]
  end

  def self.western_conf
    self.all[12..23]
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mls_standings-0.1.5 lib/mls_standings/team.rb