Class: UPS::Parsers::ShipAcceptParser
Instance Attribute Summary
Attributes inherited from BaseParser
#response
Instance Method Summary
collapse
Methods inherited from BaseParser
#error_description, #initialize, #parsed_response, #status_code, #status_description, #success?
Instance Method Details
27
28
29
30
31
|
# File 'lib/ups/parsers/ship_accept_parser.rb', line 27
def form_graphic_extension
return unless has_form_graphic?
".#{form_graphic[:Image][:ImageFormat][:Code].downcase}"
end
|
33
34
35
36
37
|
# File 'lib/ups/parsers/ship_accept_parser.rb', line 33
def form_graphic_image
return unless has_form_graphic?
Utils.base64_to_file(form_graphic[:Image][:GraphicImage], form_graphic_extension)
end
|
#label_graphic_extension ⇒ Object
Also known as:
graphic_extension
11
12
13
|
# File 'lib/ups/parsers/ship_accept_parser.rb', line 11
def label_graphic_extension
packages[0].label_graphic_extension
end
|
#label_graphic_image ⇒ Object
Also known as:
graphic_image
15
16
17
|
# File 'lib/ups/parsers/ship_accept_parser.rb', line 15
def label_graphic_image
packages[0].label_graphic_image
end
|
#label_html_image ⇒ Object
Also known as:
html_image
19
20
21
|
# File 'lib/ups/parsers/ship_accept_parser.rb', line 19
def label_html_image
packages[0].label_html_image
end
|
#packages ⇒ Object
39
40
41
42
43
|
# File 'lib/ups/parsers/ship_accept_parser.rb', line 39
def packages
return package_results.map { |package_result| UPS::Models::PackageResult.new(package_result) } if package_results.is_a?(Array)
[UPS::Models::PackageResult.new(package_results)]
end
|
#tracking_number ⇒ Object
7
8
9
|
# File 'lib/ups/parsers/ship_accept_parser.rb', line 7
def tracking_number
packages[0].tracking_number
end
|