Class: Dry::Schema::Macros::StructToSchema

Inherits:
Dry::Struct::Compiler
  • Object
show all
Defined in:
lib/dry/schema/extensions/struct.rb

Instance Method Summary collapse

Instance Method Details

#call(struct) ⇒ Object



9
10
11
# File 'lib/dry/schema/extensions/struct.rb', line 9

def call(struct)
  visit(struct.to_ast)
end

#visit_struct(node) ⇒ Object

strip away structs from AST



14
15
16
17
# File 'lib/dry/schema/extensions/struct.rb', line 14

def visit_struct(node)
  _, ast = node
  visit(ast)
end