Class: Jade::Parsing::InvalidOperatorError
- Defined in:
- lib/jade/parsing/error.rb
Constant Summary collapse
- HINTS =
{ '/=' => 'Use `!=` for inequality.', }.freeze
Instance Attribute Summary
Attributes inherited from Error
Attributes inherited from Error
Instance Method Summary collapse
- #hint ⇒ Object
-
#initialize(entry:, span:, actual:, expected: nil, committed: true, context: []) ⇒ InvalidOperatorError
constructor
A new instance of InvalidOperatorError.
- #message ⇒ Object
Methods inherited from Error
#commit, #committed?, #with_context
Methods inherited from Error
#candidates, #label, #notes, #queried_name, #to_diagnostic
Constructor Details
#initialize(entry:, span:, actual:, expected: nil, committed: true, context: []) ⇒ InvalidOperatorError
Returns a new instance of InvalidOperatorError.
141 142 143 |
# File 'lib/jade/parsing/error.rb', line 141 def initialize(entry:, span:, actual:, expected: nil, committed: true, context: []) super end |
Instance Method Details
#hint ⇒ Object
145 146 147 |
# File 'lib/jade/parsing/error.rb', line 145 def hint HINTS[actual.value] end |
#message ⇒ Object
149 150 151 |
# File 'lib/jade/parsing/error.rb', line 149 def "#{context_prefix}Invalid operator #{actual.value.inspect}.#{" #{hint}" if hint}" end |