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

Inherits:
Value show all
Defined in:
lib/dry/schema/macros/schema.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.

Macro used to specify a nested schema

Instance Attribute Summary

Attributes inherited from DSL

#chain, #predicate_inferrer, #primitive_inferrer

Instance Method Summary collapse

Methods inherited from Value

#array_type?, #build_array_type, #hash_type?, #import_steps, #maybe_type?, #respond_to_missing?

Methods inherited from DSL

#array, #custom_type?, #each, #filled, #hash, #maybe, #schema, #type, #value

Methods inherited from Core

#new, #operation, #path, #to_ast, #to_rule

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dry::Schema::Macros::Value

Instance Method Details

#call(*args, &block) ⇒ Object

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.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/dry/schema/macros/schema.rb', line 11

def call(*args, &block)
  super(*args, &nil) unless args.empty?

  if args.size.equal?(1) && (op = args.first).is_a?(Dry::Logic::Operations::Abstract)
    process_operation(op)
  end

  if block
    schema = define(*args, &block)
    import_steps(schema)
    trace << schema.to_rule
  end

  self
end