Exception: Ruby::Rego::UnificationError
- Defined in:
- lib/ruby/rego/errors.rb
Overview
Error raised during unification/pattern matching.
Instance Attribute Summary collapse
-
#pattern ⇒ Object?
readonly
-
#value ⇒ Object?
readonly
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message, pattern: nil, value: nil, location: nil) ⇒ UnificationError
constructor
Create a unification error.
Methods inherited from Error
Constructor Details
#initialize(message, pattern: nil, value: nil, location: nil) ⇒ UnificationError
Create a unification error.
187 188 189 190 191 192 193 |
# File 'lib/ruby/rego/errors.rb', line 187 def initialize(, pattern: nil, value: nil, location: nil) @pattern = pattern @value = value details = ErrorFormatting.format_details(pattern: pattern, value: value) composed = details.empty? ? : "#{} (#{details})" super(composed, location: location) end |
Instance Attribute Details
#pattern ⇒ Object? (readonly)
176 177 178 |
# File 'lib/ruby/rego/errors.rb', line 176 def pattern @pattern end |
#value ⇒ Object? (readonly)
179 180 181 |
# File 'lib/ruby/rego/errors.rb', line 179 def value @value end |