Exception: Liminal::UnsupportedPredicateError

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

Overview

Raised when a dry predicate cannot be represented.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_name:, path:, predicate:, detail: nil) ⇒ UnsupportedPredicateError

Returns a new instance of UnsupportedPredicateError.



35
36
37
38
39
40
41
42
43
44
# File 'lib/liminal/errors.rb', line 35

def initialize(source_name:, path:, predicate:, detail: nil)
  @source_name = source_name
  @path = path.map { |segment| segment.to_s.dup.freeze }.freeze
  @predicate = predicate
  detail_text = detail ? " (#{detail})" : ""
  super(<<~MESSAGE.chomp)
    Cannot compile #{source_name} at #{Path.display(path)}: unsupported predicate #{predicate}#{detail_text}.
    Add an authoritative override or register a predicate handler.
  MESSAGE
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



33
34
35
# File 'lib/liminal/errors.rb', line 33

def path
  @path
end

#predicateObject (readonly)

Returns the value of attribute predicate.



33
34
35
# File 'lib/liminal/errors.rb', line 33

def predicate
  @predicate
end

#source_nameObject (readonly)

Returns the value of attribute source_name.



33
34
35
# File 'lib/liminal/errors.rb', line 33

def source_name
  @source_name
end