Class: Dry::Schema::Predicate::Negation Private
- Inherits:
-
Object
- Object
- Dry::Schema::Predicate::Negation
- 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
- #predicate ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(predicate) ⇒ Negation
constructor
private
A new instance of Negation.
-
#to_ast ⇒ Array
(also: #ast)
private
Dump negated predicate to an AST.
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
#predicate ⇒ Object (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_ast ⇒ 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
31 32 33 |
# File 'lib/dry/schema/predicate.rb', line 31 def to_ast(...) [:not, predicate.to_ast(...)] end |