Class: Dry::Validation::InputProcessorCompiler::JSON
Constant Summary
collapse
- PREDICATE_MAP =
{
default: 'string',
none?: 'json.nil',
bool?: 'bool',
str?: 'string',
int?: 'integer',
float?: 'float',
decimal?: 'json.decimal',
date?: 'json.date',
date_time?: 'json.date_time',
time?: 'json.time'
}.freeze
- CONST_MAP =
{
NilClass => 'nil',
String => 'string',
Integer => 'integer',
Float => 'float',
BigDecimal => 'json.decimal',
Array => 'json.array',
Hash => 'json.hash',
Date => 'json.date',
DateTime => 'json.date_time',
Time => 'json.time',
TrueClass => 'true',
FalseClass => 'false'
}.freeze
DEFAULT_TYPE_NODE
Instance Attribute Summary
#type_compiler
Instance Method Summary
collapse
#call, #constructor, #initialize, #schema_ast, #type, #visit, #visit_and, #visit_each, #visit_implication, #visit_key, #visit_not, #visit_or, #visit_predicate, #visit_rule, #visit_schema, #visit_set, #visit_type, #visit_val
Instance Method Details
#array_node(members) ⇒ Object
40
41
42
|
# File 'lib/dry/validation/input_processor_compiler/json.rb', line 40
def array_node(members)
[:json_array, [members, {}]]
end
|
#hash_node(schema) ⇒ Object
36
37
38
|
# File 'lib/dry/validation/input_processor_compiler/json.rb', line 36
def hash_node(schema)
[:json_hash, [schema, {}]]
end
|
#identifier ⇒ Object
32
33
34
|
# File 'lib/dry/validation/input_processor_compiler/json.rb', line 32
def identifier
:json
end
|