Exception: GMO::Payment::Error
- Defined in:
- lib/gmo/errors.rb
Direct Known Subclasses
Constant Summary
Constants inherited from GMOError
GMOError::ERROR_INFO_SEPARATOR
Instance Attribute Summary collapse
-
#error_info ⇒ Object
Returns the value of attribute error_info.
-
#error_messages ⇒ Object
Returns the value of attribute error_messages.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#response_body ⇒ Object
Returns the value of attribute response_body.
Instance Method Summary collapse
-
#initialize(response_body = "", error_info = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response_body = "", error_info = nil) ⇒ Error
Returns a new instance of Error.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gmo/errors.rb', line 26 def initialize(response_body = "", error_info = nil) if response_body && response_body.is_a?(String) self.response_body = response_body.strip else self.response_body = '' end if error_info.nil? begin error_info = Rack::Utils.parse_nested_query(response_body.to_s) rescue error_info ||= {} end end self.error_info = error_info = self.response_body super() end |
Instance Attribute Details
#error_info ⇒ Object
Returns the value of attribute error_info.
24 25 26 |
# File 'lib/gmo/errors.rb', line 24 def error_info @error_info end |
#error_messages ⇒ Object
Returns the value of attribute error_messages.
24 25 26 |
# File 'lib/gmo/errors.rb', line 24 def @error_messages end |
#locale ⇒ Object
Returns the value of attribute locale.
24 25 26 |
# File 'lib/gmo/errors.rb', line 24 def locale @locale end |
#response_body ⇒ Object
Returns the value of attribute response_body.
24 25 26 |
# File 'lib/gmo/errors.rb', line 24 def response_body @response_body end |