Class: InPostUKAPI::Tracking

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
lib/inpost_uk_api/resources/tracking.rb

Class Method Summary collapse

Class Method Details

.find(*args) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/inpost_uk_api/resources/tracking.rb', line 9

def find(*args)
  # Handle the case when the response is an array when only 1 tracking number is passed
  # by set the request to at least 2 tracking numbers, then remove the fake one, "CS", afterwards
  args[0] += ';CS' if args[0].split(';').length == 1
  response = super
  response.attributes.delete('CS')
  response
end

.where(*args) ⇒ Object



18
19
20
# File 'lib/inpost_uk_api/resources/tracking.rb', line 18

def where(*args)
  find(*args)
end