Exception: Dentaku::TokenizerError
- Defined in:
- lib/dentaku/exceptions.rb
Constant Summary collapse
- VALID_REASONS =
%i[ parse_error too_many_closing_parentheses too_many_opening_parentheses unexpected_zero_width_match ].freeze
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Attributes inherited from Error
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(reason, **meta) ⇒ TokenizerError
constructor
A new instance of TokenizerError.
Constructor Details
#initialize(reason, **meta) ⇒ TokenizerError
Returns a new instance of TokenizerError.
62 63 64 65 |
# File 'lib/dentaku/exceptions.rb', line 62 def initialize(reason, **) @reason = reason @meta = end |
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
60 61 62 |
# File 'lib/dentaku/exceptions.rb', line 60 def @meta end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
60 61 62 |
# File 'lib/dentaku/exceptions.rb', line 60 def reason @reason end |
Class Method Details
.for(reason, **meta) ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/dentaku/exceptions.rb', line 76 def self.for(reason, **) unless VALID_REASONS.include?(reason) raise ::ArgumentError, "Unhandled #{reason}" end new(reason, **) end |