Class: Elements::ErrorDetails
Overview
Constant Summary
Elements::ElementsObject::PERMANENT_ATTRIBUTES, Elements::ElementsObject::RESERVED_FIELD_NAMES
Class Method Summary
collapse
Instance Method Summary
collapse
#[], #as_json, #initialize, #to_json
Class Method Details
.from_http_body(body) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/elements/errors.rb', line 35
def self.from_http_body(body)
return nil if body.nil?
json_body = JSON.parse(body, symbolize_names: true)
return nil unless json_body.key?(:error)
error = json_body[:error]
Util.convert_to_elements_object(error)
rescue JSON::ParserError
nil
end
|
Instance Method Details
#code ⇒ Object
11
12
13
|
# File 'lib/elements/errors.rb', line 11
def code
@attributes[:code]
end
|
#decline_code ⇒ Object
31
32
33
|
# File 'lib/elements/errors.rb', line 31
def decline_code
@attributes[:decline_code]
end
|
#message ⇒ Object
15
16
17
|
# File 'lib/elements/errors.rb', line 15
def message
@attributes[:message]
end
|
#param ⇒ Object
27
28
29
|
# File 'lib/elements/errors.rb', line 27
def param
@attributes[:param]
end
|
#psp_reference ⇒ Object
23
24
25
|
# File 'lib/elements/errors.rb', line 23
def psp_reference
@attributes[:psp_reference]
end
|
#trace_id ⇒ Object
19
20
21
|
# File 'lib/elements/errors.rb', line 19
def trace_id
@attributes[:trace_id]
end
|
#type ⇒ Object
7
8
9
|
# File 'lib/elements/errors.rb', line 7
def type
@attributes[:type]
end
|