Module: HermesAPI::ReturnLabelHelper

Included in:
DropOffReturnLabel, PickupReturnLabel
Defined in:
lib/hermes_api/shared/return_label_helper.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base_klass) ⇒ Object



9
10
11
# File 'lib/hermes_api/shared/return_label_helper.rb', line 9

def self.included(base_klass)
  base_klass.extend(ClassMethods)
end

Instance Method Details

#labelsObject Also known as: label



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hermes_api/shared/return_label_helper.rb', line 13

def labels
  entries = routing_response_entries.routing_response_entry
  if entries.is_a?(Array)
    entries.map do |entry|
      Base64.decode64(entry.inbound_carriers.label_image)
    end
  else
    Base64.decode64(entries.inbound_carriers.label_image)
  end
rescue NameError
end

#tracking_numbersObject Also known as: tracking_number



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/hermes_api/shared/return_label_helper.rb', line 27

def tracking_numbers
  entries = routing_response_entries.routing_response_entry
  if entries.is_a?(Array)
    entries.map do |entry|
      entry.inbound_carriers.carrier1.barcode1.barcode_number
    end
  else
    entries.inbound_carriers.carrier1.barcode1.barcode_number
  end
rescue NameError
end