Exception: Caplinked::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Caplinked::Error
- Defined in:
- lib/caplinked/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code = nil, message = '', headers = {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(code = nil, message = '', headers = {}) ⇒ Error
Returns a new instance of Error.
11 12 13 14 15 |
# File 'lib/caplinked/error.rb', line 11 def initialize(code = nil, = '', headers = {}) super() @code = code @headers = headers end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/caplinked/error.rb', line 3 def code @code end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/caplinked/error.rb', line 3 def headers @headers end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/caplinked/error.rb', line 3 def @message end |
Class Method Details
.from_response(body, headers) ⇒ Object
6 7 8 |
# File 'lib/caplinked/error.rb', line 6 def from_response(body, headers) new(body[:error][:code], body[:error][:message], headers) end |