Exception: Liminal::InvalidPredicateResultError
- Defined in:
- lib/liminal/errors.rb
Overview
Raised when a predicate handler returns a non-schema value.
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
-
#source_name ⇒ Object
readonly
Returns the value of attribute source_name.
Instance Method Summary collapse
-
#initialize(source_name:, path:, predicate:, detail:) ⇒ InvalidPredicateResultError
constructor
A new instance of InvalidPredicateResultError.
Constructor Details
#initialize(source_name:, path:, predicate:, detail:) ⇒ InvalidPredicateResultError
Returns a new instance of InvalidPredicateResultError.
51 52 53 54 55 56 57 |
# File 'lib/liminal/errors.rb', line 51 def initialize(source_name:, path:, predicate:, detail:) @source_name = source_name @path = path.map { |segment| segment.to_s.dup.freeze }.freeze @predicate = predicate super("Invalid result for predicate #{predicate} while compiling " \ "#{source_name} at #{Path.display(path)}: #{detail}.") end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
49 50 51 |
# File 'lib/liminal/errors.rb', line 49 def path @path end |
#predicate ⇒ Object (readonly)
Returns the value of attribute predicate.
49 50 51 |
# File 'lib/liminal/errors.rb', line 49 def predicate @predicate end |
#source_name ⇒ Object (readonly)
Returns the value of attribute source_name.
49 50 51 |
# File 'lib/liminal/errors.rb', line 49 def source_name @source_name end |