Class: Direct::API::V5::Response::Error
- Inherits:
-
Object
- Object
- Direct::API::V5::Response::Error
- Defined in:
- lib/direct/api/v5/response/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(error_data = {}) ⇒ Error
constructor
A new instance of Error.
- #to_h ⇒ Object
Constructor Details
#initialize(error_data = {}) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 |
# File 'lib/direct/api/v5/response/error.rb', line 7 def initialize(error_data = {}) @code = error_data[:error_code] = error_data[:error_string] @details = error_data[:error_detail] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/direct/api/v5/response/error.rb', line 3 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
5 6 7 |
# File 'lib/direct/api/v5/response/error.rb', line 5 def details @details end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/direct/api/v5/response/error.rb', line 4 def end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/direct/api/v5/response/error.rb', line 13 def to_h { code: code, message: , details: details } end |