Class: Pluggy::Services::CategoryService

Inherits:
BaseService show all
Defined in:
lib/pluggy/services/other_services.rb

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Pluggy::Services::BaseService

Instance Method Details

#list(parent_id: nil) ⇒ Object

GET /categories. The spec declares a bare array but its own example is a page envelope, so the shape is sniffed at runtime; either way you get a list that answers #each.



168
169
170
# File 'lib/pluggy/services/other_services.rb', line 168

def list(parent_id: nil)
  list_request("/categories", klass: Resources::Category, parentId: parent_id)
end

#retrieve(id) ⇒ Object



172
173
174
175
# File 'lib/pluggy/services/other_services.rb', line 172

def retrieve(id)
  require_args!(id: id)
  object_request(:get, "/categories/#{id}", klass: Resources::Category)
end