Class: Pathway::Error
- Inherits:
-
Object
- Object
- Pathway::Error
- Defined in:
- lib/pathway.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #deconstruct ⇒ Object
- #deconstruct_keys(_) ⇒ Object
-
#initialize(type:, message: nil, details: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(type:, message: nil, details: nil) ⇒ Error
Returns a new instance of Error.
42 43 44 45 46 |
# File 'lib/pathway.rb', line 42 def initialize(type:, message: nil, details: nil) @type = type.to_sym @message = || (type) @details = details || {} end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
37 38 39 |
# File 'lib/pathway.rb', line 37 def details @details end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
37 38 39 |
# File 'lib/pathway.rb', line 37 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
37 38 39 |
# File 'lib/pathway.rb', line 37 def type @type end |
Instance Method Details
#deconstruct ⇒ Object
48 49 50 |
# File 'lib/pathway.rb', line 48 def deconstruct [type, , details] end |
#deconstruct_keys(_) ⇒ Object
52 53 54 |
# File 'lib/pathway.rb', line 52 def deconstruct_keys(_) { type: type, message: , details: details } end |