Exception: Liminal::InvalidPredicateResultError

Inherits:
Error
  • Object
show all
Defined in:
lib/liminal/errors.rb

Overview

Raised when a predicate handler returns a non-schema value.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



49
50
51
# File 'lib/liminal/errors.rb', line 49

def path
  @path
end

#predicateObject (readonly)

Returns the value of attribute predicate.



49
50
51
# File 'lib/liminal/errors.rb', line 49

def predicate
  @predicate
end

#source_nameObject (readonly)

Returns the value of attribute source_name.



49
50
51
# File 'lib/liminal/errors.rb', line 49

def source_name
  @source_name
end