Class: Dry::Schema::Macros::Optional Private

Inherits:
Key
  • Object
show all
Defined in:
lib/dry/schema/macros/optional.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 Key specialization used for keys that can be skipped

Instance Attribute Summary

Attributes inherited from Key

#filter_schema_dsl

Attributes inherited from DSL

#chain, #predicate_inferrer

Instance Method Summary collapse

Methods inherited from Key

#filled, #filter, #maybe, #to_ast, #value

Methods inherited from DSL

#array, #each, #filled, #hash, #schema, #type, #value

Methods inherited from Core

#new, #to_ast

Instance Method Details

#operationObject

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.



13
14
15
# File 'lib/dry/schema/macros/optional.rb', line 13

def operation
  :then
end

#to_ruleObject

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.



18
19
20
# File 'lib/dry/schema/macros/optional.rb', line 18

def to_rule
  super unless trace.captures.empty?
end