Class: Jordan_Edition

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

Overview

Super

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Jordan_Edition



7
8
9
10
11
12
# File 'lib/Jordan_Edition.rb', line 7

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

Instance Attribute Details

#hrefObject

Returns the value of attribute href.



3
4
5
# File 'lib/Jordan_Edition.rb', line 3

def href
  @href
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/Jordan_Edition.rb', line 3

def name
  @name
end

#shoe_collectionObject

Returns the value of attribute shoe_collection.



3
4
5
# File 'lib/Jordan_Edition.rb', line 3

def shoe_collection
  @shoe_collection
end

Class Method Details

.allObject



20
21
22
# File 'lib/Jordan_Edition.rb', line 20

def self.all
  @@all 
end

.create_from_collection(array_of_hash) ⇒ Object

find or create would be better



14
15
16
17
18
# File 'lib/Jordan_Edition.rb', line 14

def self.create_from_collection(array_of_hash) #find or create would be better 

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