Class: DearInventory::Resource

Inherits:
Object
  • Object
show all
Extended by:
IsASubclass, T::Sig
Defined in:
lib/dear_inventory/resource.rb

Instance Method Summary collapse

Methods included from IsASubclass

is_a?

Instance Method Details

#request(action, model:, endpoint: nil, params: {}) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/dear_inventory/resource.rb', line 17

def request(action, model:, endpoint: nil, params: {})
  request = DearInventory::Models::Request.new(
    action: action,
    model: model,
    params: DearInventory::Parameters.convert(self.class, endpoint, params),
    uri: resource_uri(endpoint)
  )
  DearInventory::Request.(request)
end