Class: Newegg::Category

Inherits:
Api
  • Object
show all
Defined in:
lib/newegg/category.rb

Constant Summary

Constants inherited from Api

Api::DefaultUserAgent, Api::UserAgents

Instance Attribute Summary collapse

Attributes inherited from Api

#_categories, #_id, #_stores, #conn

Instance Method Summary collapse

Methods inherited from Api

#banners, #categories, #client_config, #combo_deals, #connection, #country, #daily_deal, #details, #exclusive_deals, #keywords, #navigate, #power_search, #power_search_content, #query, #reviews, #search, #shell_shockers, #shell_shockers_new, #shop_all_navigation, #shop_more_navigation, #shopping_guide, #specifications, #spotlight, #spotlights, #store_content, #store_navigate, #stores

Constructor Details

#initialize(description, category_type, category_id, store_id, show_see_all_deals, node_id) ⇒ Category

Returns a new instance of Category.



5
6
7
8
9
10
11
12
# File 'lib/newegg/category.rb', line 5

def initialize(description, category_type, category_id, store_id, show_see_all_deals, node_id)
  self.description = description
  self.category_type = category_type
  self.category_id = category_id
  self.store_id = store_id
  self.show_see_all_deals = show_see_all_deals
  self.node_id = node_id
end

Instance Attribute Details

#category_idObject

Returns the value of attribute category_id.



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

def category_id
  @category_id
end

#category_typeObject

Returns the value of attribute category_type.



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

def category_type
  @category_type
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#node_idObject

Returns the value of attribute node_id.



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

def node_id
  @node_id
end

#show_see_all_dealsObject

Returns the value of attribute show_see_all_deals.



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

def show_see_all_deals
  @show_see_all_deals
end

#store_idObject

Returns the value of attribute store_id.



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

def store_id
  @store_id
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/newegg/category.rb', line 14

def to_h
  @h ||= {
      :description   => description,
      :category_type => category_type,
      :category_id   => category_id,
      :store_id      => store_id,
      :node_id       => node_id
  }.freeze
  @h
end