Exception: Arango::ErrorDB
- Defined in:
- lib/arango/error_db.rb
Overview
Arango ErrorDB
Constant Summary
Constants inherited from Error
Arango::Error::ARANGODB_ERRORS
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#error_num ⇒ Object
readonly
Returns the value of attribute error_num.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(message:, code:, data:, error_num:, action: nil, url: nil, request:) ⇒ ErrorDB
constructor
Create database error representation.
-
#to_h ⇒ Hash
convert to hash.
Constructor Details
#initialize(message:, code:, data:, error_num:, action: nil, url: nil, request:) ⇒ ErrorDB
Create database error representation
9 10 11 12 13 14 15 16 17 |
# File 'lib/arango/error_db.rb', line 9 def initialize(message:, code:, data:, error_num:, action: nil, url: nil, request:) @message = @code = code @data = data @error_num = error_num @action = action @url = url @request = request end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
18 19 20 |
# File 'lib/arango/error_db.rb', line 18 def action @action end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
18 19 20 |
# File 'lib/arango/error_db.rb', line 18 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
18 19 20 |
# File 'lib/arango/error_db.rb', line 18 def data @data end |
#error_num ⇒ Object (readonly)
Returns the value of attribute error_num.
18 19 20 |
# File 'lib/arango/error_db.rb', line 18 def error_num @error_num end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
18 19 20 |
# File 'lib/arango/error_db.rb', line 18 def @message end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
18 19 20 |
# File 'lib/arango/error_db.rb', line 18 def request @request end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
18 19 20 |
# File 'lib/arango/error_db.rb', line 18 def url @url end |
Instance Method Details
#to_h ⇒ Hash
convert to hash
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/arango/error_db.rb', line 23 def to_h { action: @action, url: @url, request: @request, message: @message, code: @code, data: @data, errorNum: @error_num }.delete_if{|_,v| v.nil?} end |