Class: Dry::Schema::Predicate::Negation Private

Inherits:
Object
  • Object
show all
Includes:
Logic::Operators
Defined in:
lib/dry/schema/predicate.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A negated predicate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(predicate) ⇒ Negation

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Negation.



22
23
24
# File 'lib/dry/schema/predicate.rb', line 22

def initialize(predicate)
  @predicate = predicate
end

Instance Attribute Details

#predicateObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/dry/schema/predicate.rb', line 19

def predicate
  @predicate
end

Instance Method Details

#to_astArray Also known as: ast

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Dump negated predicate to an AST

Returns:

  • (Array)


31
32
33
# File 'lib/dry/schema/predicate.rb', line 31

def to_ast(...)
  [:not, predicate.to_ast(...)]
end