Class: Direct::API::V5::Response::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/direct/api/v5/response/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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]
  @message = error_data[:error_string]
  @details = error_data[:error_detail]
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/direct/api/v5/response/error.rb', line 3

def code
  @code
end

#detailsObject (readonly)

Returns the value of attribute details.



5
6
7
# File 'lib/direct/api/v5/response/error.rb', line 5

def details
  @details
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/direct/api/v5/response/error.rb', line 4

def message
  @message
end

Instance Method Details

#to_hObject



13
14
15
16
17
18
19
# File 'lib/direct/api/v5/response/error.rb', line 13

def to_h
  {
    code: code,
    message: message,
    details: details
  }
end