Class: EcwidApi::Category
Instance Method Summary collapse
-
#parent ⇒ Object
Public: Returns the parent EcwidApi::Category, or nil if there isn’t one.
-
#sub_categories ⇒ Object
Public: Returns an Array of sub categories for the Category.
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
#parent ⇒ Object
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_categories ⇒ Object
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 |