Class: Epages::Category
- Inherits:
-
Object
- Object
- Epages::Category
- Includes:
- Utils
- Defined in:
- lib/epages/category.rb
Constant Summary collapse
- KEYS =
%w(category_id name page_title description special_offer images parent sub_categories sf_url links visible).collect(&:to_sym).freeze
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(data) ⇒ Category
constructor
A new instance of Category.
Methods included from Utils
build_shop_from, camelize_keys, camelize_words, options_to_multipart_request, options_to_patch_request, parse_attribute_as, parse_attribute_as_array_of, parse_attributes, symbolize_keys!, to_query_options, underscorize_keys
Constructor Details
#initialize(data) ⇒ Category
Returns a new instance of Category.
12 13 14 15 16 17 18 |
# File 'lib/epages/category.rb', line 12 def initialize(data) parse_attribute_as_array_of('images', data.delete(:images), Epages::Image) parse_attribute_as_array_of('links', data.delete(:links), Epages::Link) parse_attribute_as_array_of('sub_categories', data.delete(:subCategories), Epages::Link) @parent = Epages::Link.new(data.delete(:parent)) if data[:parent] parse_attributes(data) end |