Sha256: c8d7157bb103eca7854bd0019cd523d91b7e11c7ac4112be9f13bb45be6312ca

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..10]
  end

  def self.western_conf
    self.all[11..22]
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

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