Class: Mirakl::Requests::DR12

Inherits:
Object
  • Object
show all
Includes:
ApiOperations::Request
Defined in:
lib/mirakl/requests/dr12.rb

Class Method Summary collapse

Methods included from ApiOperations::Request

included, #request

Class Method Details

.call(document_request_id, params = {}, opts = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mirakl/requests/dr12.rb', line 8

def self.call(document_request_id, params = {}, opts = {})
  if document_request_id.blank?
    raise ArgumentError,
      "You must fill the `document_request_id` value to call the DR12 API endpoint"
  end

  api_path = "document-request/#{document_request_id}/lines"

  resp, opts = request(:get, api_path, params, opts)
  obj = MiraklObject.construct_from(resp.data, opts)

  obj
end