Exception: Dentaku::ArgumentError
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- Dentaku::ArgumentError
- Defined in:
- lib/dentaku/exceptions.rb
Constant Summary collapse
- VALID_REASONS =
%i[ incompatible_type invalid_operator invalid_value too_few_arguments wrong_number_of_arguments ].freeze
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#recipient_variable ⇒ Object
Returns the value of attribute recipient_variable.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(reason, **meta) ⇒ ArgumentError
constructor
A new instance of ArgumentError.
Constructor Details
#initialize(reason, **meta) ⇒ ArgumentError
Returns a new instance of ArgumentError.
89 90 91 92 |
# File 'lib/dentaku/exceptions.rb', line 89 def initialize(reason, **) @reason = reason @meta = end |
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
86 87 88 |
# File 'lib/dentaku/exceptions.rb', line 86 def @meta end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
86 87 88 |
# File 'lib/dentaku/exceptions.rb', line 86 def reason @reason end |
#recipient_variable ⇒ Object
Returns the value of attribute recipient_variable.
87 88 89 |
# File 'lib/dentaku/exceptions.rb', line 87 def recipient_variable @recipient_variable end |
Class Method Details
.for(reason, **meta) ⇒ Object
104 105 106 107 108 109 110 |
# File 'lib/dentaku/exceptions.rb', line 104 def self.for(reason, **) unless VALID_REASONS.include?(reason) raise ::ArgumentError, "Unhandled #{reason}" end new(reason, **) end |