Class: Ingenico::Connect::SDK::Domain::Errors::APIError
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Errors::APIError
- Defined in:
- lib/ingenico/connect/sdk/domain/errors/api_error.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
String.
-
#code ⇒ Object
String.
-
#http_status_code ⇒ Object
Integer.
-
#id ⇒ Object
String.
-
#message ⇒ Object
String.
-
#property_name ⇒ Object
String.
-
#request_id ⇒ Object
String.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#category ⇒ Object
String
14 15 16 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 14 def category @category end |
#code ⇒ Object
String
17 18 19 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 17 def code @code end |
#http_status_code ⇒ Object
Integer
20 21 22 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 20 def http_status_code @http_status_code end |
#id ⇒ Object
String
23 24 25 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 23 def id @id end |
#message ⇒ Object
String
26 27 28 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 26 def @message end |
#property_name ⇒ Object
String
29 30 31 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 29 def property_name @property_name end |
#request_id ⇒ Object
String
32 33 34 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 32 def request_id @request_id end |
Instance Method Details
#from_hash(hash) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 46 def from_hash(hash) super if hash.has_key?('category') @category = hash['category'] end if hash.has_key?('code') @code = hash['code'] end if hash.has_key?('httpStatusCode') @http_status_code = hash['httpStatusCode'] end if hash.has_key?('id') @id = hash['id'] end if hash.has_key?('message') @message = hash['message'] end if hash.has_key?('propertyName') @property_name = hash['propertyName'] end if hash.has_key?('requestId') @request_id = hash['requestId'] end end |
#to_h ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ingenico/connect/sdk/domain/errors/api_error.rb', line 34 def to_h hash = super add_to_hash(hash, 'category', @category) add_to_hash(hash, 'code', @code) add_to_hash(hash, 'httpStatusCode', @http_status_code) add_to_hash(hash, 'id', @id) add_to_hash(hash, 'message', @message) add_to_hash(hash, 'propertyName', @property_name) add_to_hash(hash, 'requestId', @request_id) hash end |