Exception: Kreator::ToolError
- Inherits:
-
StandardError
- Object
- StandardError
- Kreator::ToolError
- Defined in:
- lib/kreator/tool_error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
Instance Method Summary collapse
-
#initialize(message, code: "runtime_error", details: {}) ⇒ ToolError
constructor
A new instance of ToolError.
- #to_h ⇒ Object
Constructor Details
#initialize(message, code: "runtime_error", details: {}) ⇒ ToolError
Returns a new instance of ToolError.
7 8 9 10 11 |
# File 'lib/kreator/tool_error.rb', line 7 def initialize(, code: "runtime_error", details: {}) super() @code = code.to_s @details = details || {} end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/kreator/tool_error.rb', line 5 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
5 6 7 |
# File 'lib/kreator/tool_error.rb', line 5 def details @details end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/kreator/tool_error.rb', line 13 def to_h { "code" => code, "class" => self.class.name, "message" => , "details" => details } end |