Class: Brand
- Inherits:
-
Object
- Object
- Brand
- Defined in:
- lib/brand.rb
Overview
< Super
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#brand_href ⇒ Object
Returns the value of attribute brand_href.
-
#brand_name ⇒ Object
Returns the value of attribute brand_name.
-
#edition_href ⇒ Object
Returns the value of attribute edition_href.
-
#editions ⇒ Object
Returns the value of attribute editions.
-
#shoe_collection ⇒ Object
Returns the value of attribute shoe_collection.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Brand
constructor
A new instance of Brand.
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_href ⇒ Object
Returns the value of attribute brand_href.
4 5 6 |
# File 'lib/brand.rb', line 4 def brand_href @brand_href end |
#brand_name ⇒ Object
Returns the value of attribute brand_name.
4 5 6 |
# File 'lib/brand.rb', line 4 def brand_name @brand_name end |
#edition_href ⇒ Object
Returns the value of attribute edition_href.
4 5 6 |
# File 'lib/brand.rb', line 4 def edition_href @edition_href end |
#editions ⇒ Object
Returns the value of attribute editions.
4 5 6 |
# File 'lib/brand.rb', line 4 def editions @editions end |
#shoe_collection ⇒ Object
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
.all ⇒ Object
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 |