Class: Pennylane::Supplier

Inherits:
Resources::Base show all
Defined in:
lib/pennylane/resources/supplier.rb

Instance Attribute Summary

Attributes inherited from Object

#id

Class Method Summary collapse

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



14
15
16
# File 'lib/pennylane/resources/supplier.rb', line 14

def create params, opts = {}
  request_pennylane_object(method: :post, path: "/suppliers", params: { body: { object_name => params } }, opts: opts)
end

.list(filters = {}, opts = {}) ⇒ Object



5
6
7
8
# File 'lib/pennylane/resources/supplier.rb', line 5

def list filters = {}, opts = {}
  normalize_filters(filters)
  request_pennylane_object(method: :get, path: "/suppliers", params: { query: filters }, opts: opts)
end

.retrieve(supplier_id, opts = {}) ⇒ Object



10
11
12
# File 'lib/pennylane/resources/supplier.rb', line 10

def retrieve supplier_id, opts = {}
  request_pennylane_object(method: :get, path: "/suppliers/#{supplier_id}", params: {}, opts: opts)
end