Class: BestBuy::Category
- Inherits:
-
BaseCategory
- Object
- BaseCategory
- BestBuy::Category
- Defined in:
- lib/best_buy/models/category.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#sub_categories ⇒ Object
readonly
Returns the value of attribute sub_categories.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from BaseCategory
Instance Method Summary collapse
-
#initialize(init_params) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(init_params) ⇒ Category
Returns a new instance of Category.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/best_buy/models/category.rb', line 9 def initialize(init_params) @url = init_params[:url] @active = init_params[:active] @path = init_params[:path] @sub_categories = init_params[:sub_categories].map do |sub_category| BaseCategory.new(sub_category) end super(init_params) end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
7 8 9 |
# File 'lib/best_buy/models/category.rb', line 7 def active @active end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/best_buy/models/category.rb', line 7 def path @path end |
#sub_categories ⇒ Object (readonly)
Returns the value of attribute sub_categories.
7 8 9 |
# File 'lib/best_buy/models/category.rb', line 7 def sub_categories @sub_categories end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/best_buy/models/category.rb', line 7 def url @url end |