Class: BestBuy::Category

Inherits:
BaseCategory show all
Defined in:
lib/best_buy/models/category.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCategory

#id, #name

Instance Method Summary collapse

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

#activeObject (readonly)

Returns the value of attribute active.



7
8
9
# File 'lib/best_buy/models/category.rb', line 7

def active
  @active
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/best_buy/models/category.rb', line 7

def path
  @path
end

#sub_categoriesObject (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

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/best_buy/models/category.rb', line 7

def url
  @url
end