Class: Super

Inherits:
Object
  • Object
show all
Defined in:
lib/super.rb

Constant Summary collapse

@@all =
[]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Super



5
6
7
8
9
10
# File 'lib/super.rb', line 5

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

Class Method Details

.allObject



19
20
21
# File 'lib/super.rb', line 19

def self.all 
    @@all 
end

.create_from_collection(array_of_hash) ⇒ Object



12
13
14
15
16
# File 'lib/super.rb', line 12

def self.create_from_collection(array_of_hash) 
  array_of_hash.each do |hash|
    self.new(hash)
  end 
end