Skip to content

Commit

Permalink
Removes non-threadsafe, non-scalable memoization
Browse files Browse the repository at this point in the history
  • Loading branch information
fedenusy committed Sep 2, 2015
1 parent fbd654e commit df28640
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
5 changes: 0 additions & 5 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ You can get all kinds of info from a player:
bob.games_played # => 8
bob.games # => [ game1, game2, ... game8 ]

Or get a list of players:

Elo::Player.all # => [ bob, jane ]
Elo::Game.all # => [ game1, game2, ... game8 ]


== Configuration

Expand Down
14 changes: 0 additions & 14 deletions lib/elo/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,12 @@ module Elo

module Helper

def self.included(base)
base.extend ClassMethods
end

# Every object can be initialized with a hash,
# almost, but not quite, entirely unlike ActiveRecord.
def initialize(attributes = {})
attributes.each do |key, value|
instance_variable_set("@#{key}", value)
end
self.class.all << self
end

module ClassMethods

# Provides a list of all instantiated objects of the class.
def all
@all ||= []
end

end

end
Expand Down
3 changes: 0 additions & 3 deletions spec/elo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
bob.games_played.should == 8
bob.games.should == [ game1, game2, game3, game4, game5, game6, game7, game8 ]

Elo::Player.all.should == [ bob, jane ]
Elo::Game.all.should == [ game1, game2, game3, game4, game5, game6, game7, game8 ]

end

describe "Configuration" do
Expand Down

0 comments on commit df28640

Please sign in to comment.