Sha256: 6f2640501aeb97e54219a0abe9977a19993d28d3f510849e6513ba610745f0e0

Contents?: true

Size: 1.21 KB

Versions: 8

Compression:

Stored size: 1.21 KB

Contents

module Dry
  module Validation
    class InputProcessorCompiler::Params < InputProcessorCompiler
      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

      def identifier
        :params
      end

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-validation-0.13.3 lib/dry/validation/input_processor_compiler/params.rb
dry-validation-0.13.2 lib/dry/validation/input_processor_compiler/params.rb
dry-validation-0.13.1 lib/dry/validation/input_processor_compiler/params.rb
dry-validation-0.12.3 lib/dry/validation/input_processor_compiler/params.rb
dry-validation-0.13.0 lib/dry/validation/input_processor_compiler/params.rb
dry-validation-0.12.2 lib/dry/validation/input_processor_compiler/params.rb
dry-validation-0.12.1 lib/dry/validation/input_processor_compiler/params.rb
dry-validation-0.12.0 lib/dry/validation/input_processor_compiler/params.rb