Class: Dry::Validation::InputProcessorCompiler::Params

Inherits:
Dry::Validation::InputProcessorCompiler show all
Defined in:
lib/dry/validation/input_processor_compiler/params.rb

Constant Summary collapse

PREDICATE_MAP =
{
  default: 'string',
  none?: 'params.nil',
  bool?: 'params.bool',
  true?: 'params.true',
  false?: 'params.false',
  str?: 'string',
  int?: 'params.integer',
  float?: 'params.float',
  decimal?: 'params.decimal',
  date?: 'params.date',
  date_time?: 'params.date_time',
  time?: 'params.time',
  hash?: 'params.hash',
  array?: 'params.array'
}.freeze
CONST_MAP =
{
  NilClass => 'params.nil',
  String => 'string',
  Integer => 'params.integer',
  Float => 'params.float',
  BigDecimal => 'params.decimal',
  Array => 'params.array',
  Hash => 'params.hash',
  Date => 'params.date',
  DateTime => 'params.date_time',
  Time => 'params.time',
  TrueClass => 'params.true',
  FalseClass => 'params.false'
}.freeze

Constants inherited from Dry::Validation::InputProcessorCompiler

DEFAULT_TYPE_NODE

Instance Attribute Summary

Attributes inherited from Dry::Validation::InputProcessorCompiler

#type_compiler

Instance Method Summary collapse

Methods inherited from Dry::Validation::InputProcessorCompiler

#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

Constructor Details

This class inherits a constructor from Dry::Validation::InputProcessorCompiler

Instance Method Details

#array_node(members) ⇒ Object



44
45
46
# File 'lib/dry/validation/input_processor_compiler/params.rb', line 44

def array_node(members)
  [:params_array, [members, {}]]
end

#hash_node(schema) ⇒ Object



40
41
42
# File 'lib/dry/validation/input_processor_compiler/params.rb', line 40

def hash_node(schema)
  [:params_hash, [schema, {}]]
end

#identifierObject



36
37
38
# File 'lib/dry/validation/input_processor_compiler/params.rb', line 36

def identifier
  :params
end