Sha256: 9f1bb1363894071a38f25d495262ac76f3363734644536302f3e67418da5398c

Contents?: true

Size: 823 Bytes

Versions: 1

Compression:

Stored size: 823 Bytes

Contents

class KnicksHistory::Season

  attr_accessor :year, :wins, :losses, :win_percentage, :off_rating, :def_rating, :best_player_ws, :pace, :playoff_results

  @@all = {}

  def initialize(season_hash = nil)
    if season_hash != nil
      @year = season_hash[:year]
      @wins = season_hash[:wins]
      @losses = season_hash[:losses]
      @win_percentage = season_hash[:win_percentage]
      @off_rating = season_hash[:off_rating]
      @def_rating = season_hash[:def_rating]
      @best_player_ws = season_hash[:best_player_ws]
      @pace = season_hash[:pace]
      @playoff_results = season_hash[:playoff_results]
      @@all[@year] = self
    end
  end

  def self.all
    @@all
  end

  def self.find_season(year)
    @@all.detect do |season|
      season[0] == year.to_s
    end
  end

  def year
    @year
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
knicks_history-0.1.1 lib/knicks_history/season.rb