Class: Pennylane::Product
- Inherits:
-
Resources::Base
- Object
- Object
- Resources::Base
- Pennylane::Product
- Defined in:
- lib/pennylane/resources/product.rb
Instance Attribute Summary
Attributes inherited from Object
Class Method Summary collapse
- .create(params, opts = {}) ⇒ Object
- .list(filters = {}, opts = {}) ⇒ Object
- .retrieve(id, opts = {}) ⇒ Object
Methods inherited from Resources::Base
#[], client, execute_resource_request, #id, #method_missing, normalize_filters, #object, object_name, object_name_plural, request_pennylane_object, #respond_to_missing?, #update
Methods inherited from Object
build_from, descendants, #initialize_from_response, objects, protected_fields
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Pennylane::Resources::Base
Class Method Details
.create(params, opts = {}) ⇒ Object
15 16 17 |
# File 'lib/pennylane/resources/product.rb', line 15 def create params, opts = {} request_pennylane_object(method: :post, path: "/products", params: { body: { product: params } }, opts: opts) end |
.list(filters = {}, opts = {}) ⇒ Object
6 7 8 9 |
# File 'lib/pennylane/resources/product.rb', line 6 def list filters = {}, opts = {} normalize_filters(filters) request_pennylane_object(method: :get, path: "/products", params: { query: filters }, opts: opts) end |
.retrieve(id, opts = {}) ⇒ Object
11 12 13 |
# File 'lib/pennylane/resources/product.rb', line 11 def retrieve id, opts = {} request_pennylane_object(method: :get, path: "/products/#{id}", params: {}, opts: opts) end |