Class: EcwidApi::Category

Inherits:
Entity
  • Object
show all
Defined in:
lib/ecwid_api/category.rb

Instance Method Summary collapse

Methods inherited from Entity

#[], #initialize, #method_missing

Constructor Details

This class inherits a constructor from EcwidApi::Entity

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EcwidApi::Entity

Instance Method Details

#parentObject

Public: Returns the parent EcwidApi::Category, or nil if there isn’t one



9
10
11
12
# File 'lib/ecwid_api/category.rb', line 9

def parent
  parent_id = data["parentId"]
  client.categories.find(parent_id) if parent_id
end

#sub_categoriesObject

Public: Returns an Array of sub categories for the Category



4
5
6
# File 'lib/ecwid_api/category.rb', line 4

def sub_categories
  @sub_categories ||= client.categories.all(id)
end