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

Inherits:
Object
  • Object
show all
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.



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

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.



17
18
19
# File 'lib/dry/schema/predicate.rb', line 17

def predicate
  @predicate
end

Instance Method Details

#to_ast(*args) ⇒ Array 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)


29
30
31
# File 'lib/dry/schema/predicate.rb', line 29

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