Class: Myparcel::API::Tracktraces

Inherits:
Base
  • Object
show all
Defined in:
lib/myparcel/api/tracktraces.rb

Overview

Class for managing tracktraces

Instance Attribute Summary

Attributes inherited from Base

#authentication

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Myparcel::API::Base

Instance Method Details

#find(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/myparcel/api/tracktraces.rb', line 5

def find(options = {})
  shipment_ids = options.fetch(:shipment_ids, [])
  raise 'options[:shipment_ids] cannot be empty' if shipment_ids.empty?
  shipment_ids = shipment_ids.join(';')
  full_path = [path, shipment_ids].join('/')
  response = request :get, full_path, options
  response['data']['tracktraces']
end

#pathObject



14
15
16
# File 'lib/myparcel/api/tracktraces.rb', line 14

def path
  'tracktraces'
end