Class: Brand

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

Overview

< Super

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Brand

Returns a new instance of Brand.



8
9
10
11
12
13
# File 'lib/brand.rb', line 8

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

Instance Attribute Details

#brand_hrefObject

Returns the value of attribute brand_href.



4
5
6
# File 'lib/brand.rb', line 4

def brand_href
  @brand_href
end

#brand_nameObject

Returns the value of attribute brand_name.



4
5
6
# File 'lib/brand.rb', line 4

def brand_name
  @brand_name
end

#edition_hrefObject

Returns the value of attribute edition_href.



4
5
6
# File 'lib/brand.rb', line 4

def edition_href
  @edition_href
end

#editionsObject

Returns the value of attribute editions.



4
5
6
# File 'lib/brand.rb', line 4

def editions
  @editions
end

#shoe_collectionObject

Returns the value of attribute shoe_collection.



4
5
6
# File 'lib/brand.rb', line 4

def shoe_collection
  @shoe_collection
end

Class Method Details

.allObject



21
22
23
# File 'lib/brand.rb', line 21

def self.all 
    @@all 
end

.create_from_collection(array_of_hash) ⇒ Object



15
16
17
18
19
# File 'lib/brand.rb', line 15

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