Class: NovaposhtaApi::Resources::TrackingDocumentResource

Inherits:
NovaposhtaApi::Resource show all
Defined in:
lib/novaposhta_api/resources/tracking_document_resource.rb

Instance Attribute Summary

Attributes inherited from NovaposhtaApi::Resource

#http

Instance Method Summary collapse

Methods inherited from NovaposhtaApi::Resource

#initialize, #request

Constructor Details

This class inherits a constructor from NovaposhtaApi::Resource

Instance Method Details

#track(number) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/novaposhta_api/resources/tracking_document_resource.rb', line 6

def track(number)
  response = request(
    'TrackingDocument/getStatusDocuments',
    Documents: [
      {
        DocumentNumber: number
      }
    ]
  )

  NovaposhtaApi::Models::TrackingDocument.extract_single(response)
end