Class: Utility::Error
- Inherits:
-
Object
- Object
- Utility::Error
- Defined in:
- lib/utility/errors.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code, code, message) ⇒ Error
constructor
A new instance of Error.
- #to_h ⇒ Object
Constructor Details
#initialize(status_code, code, message) ⇒ Error
Returns a new instance of Error.
99 100 101 102 103 |
# File 'lib/utility/errors.rb', line 99 def initialize(status_code, code, ) @status_code = status_code @code = code @message = end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
97 98 99 |
# File 'lib/utility/errors.rb', line 97 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
97 98 99 |
# File 'lib/utility/errors.rb', line 97 def @message end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
97 98 99 |
# File 'lib/utility/errors.rb', line 97 def status_code @status_code end |
Instance Method Details
#to_h ⇒ Object
105 106 107 108 109 110 |
# File 'lib/utility/errors.rb', line 105 def to_h { 'code' => @code, 'message' => @message } end |