Module: Elo::Helper

Included in:
Game, Player, Rating
Defined in:
lib/elo/helper.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/elo/helper.rb', line 5

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

Instance Method Details

#initialize(attributes = {}) ⇒ Object

almost, but not quite, entirely unlike ActiveRecord.



11
12
13
14
15
16
# File 'lib/elo/helper.rb', line 11

def initialize(attributes = {})
  attributes.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
  self.class.all << self
end