Class: GmoServices::Payments::Error
- Inherits:
-
Object
- Object
- GmoServices::Payments::Error
- Defined in:
- lib/gmo_services/payments/error.rb
Constant Summary collapse
- ERROR_INFO_SEPARATOR =
'|'.freeze
Instance Attribute Summary collapse
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#response_body ⇒ Object
Returns the value of attribute response_body.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(response_body, locale = :en) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response_body, locale = :en) ⇒ Error
Returns a new instance of Error.
8 9 10 11 |
# File 'lib/gmo_services/payments/error.rb', line 8 def initialize(response_body, locale = :en) @response_body = response_body @locale = locale end |
Instance Attribute Details
#locale ⇒ Object
Returns the value of attribute locale.
4 5 6 |
# File 'lib/gmo_services/payments/error.rb', line 4 def locale @locale end |
#response_body ⇒ Object
Returns the value of attribute response_body.
4 5 6 |
# File 'lib/gmo_services/payments/error.rb', line 4 def response_body @response_body end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/gmo_services/payments/error.rb', line 13 def call error_info_array = response_body['ErrInfo'].split(ERROR_INFO_SEPARATOR) = error_info_array.map { |error_info| translate(error_info) } = .join(ERROR_INFO_SEPARATOR) response_body['ErrMessage'] = response_body end |