Class: Dry::Schema::Predicate::Negation Private
- Inherits:
-
Object
- Object
- Dry::Schema::Predicate::Negation
- 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(*args) ⇒ 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.
20 21 22 |
# File 'lib/dry/schema/predicate.rb', line 20 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.
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
29 30 31 |
# File 'lib/dry/schema/predicate.rb', line 29 def to_ast(*args) [:not, predicate.to_ast(*args)] end |