Class: UPS::Parsers::BaseParser
- Inherits:
-
Object
- Object
- UPS::Parsers::BaseParser
show all
- Defined in:
- lib/ups/parsers/base_parser.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(response) ⇒ BaseParser
Returns a new instance of BaseParser.
9
10
11
|
# File 'lib/ups/parsers/base_parser.rb', line 9
def initialize(response)
@response = response
end
|
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
7
8
9
|
# File 'lib/ups/parsers/base_parser.rb', line 7
def response
@response
end
|
Instance Method Details
#error_description ⇒ Object
25
26
27
|
# File 'lib/ups/parsers/base_parser.rb', line 25
def error_description
build_error_description(error_response)
end
|
#parsed_response ⇒ Object
29
30
31
|
# File 'lib/ups/parsers/base_parser.rb', line 29
def parsed_response
@parsed_response ||= Ox.load(response, mode: :hash)
end
|
#status_code ⇒ Object
17
18
19
|
# File 'lib/ups/parsers/base_parser.rb', line 17
def status_code
root_response[:Response][:ResponseStatusCode]
end
|
#status_description ⇒ Object
21
22
23
|
# File 'lib/ups/parsers/base_parser.rb', line 21
def status_description
root_response[:Response][:ResponseStatusDescription]
end
|
#success? ⇒ Boolean
13
14
15
|
# File 'lib/ups/parsers/base_parser.rb', line 13
def success?
status_code == '1'
end
|