Class: Dry::Validation::Schema::Form
- Inherits:
-
Dry::Validation::Schema
- Object
- Dry::Validation::Schema
- Dry::Validation::Schema::Form
- Defined in:
- lib/dry/validation/schema/form.rb
Instance Attribute Summary collapse
-
#input_type ⇒ Object
readonly
Returns the value of attribute input_type.
Attributes inherited from Dry::Validation::Schema
#checks, #error_compiler, #groups, #hint_compiler, #rules, #schemas
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize ⇒ Form
constructor
A new instance of Form.
Methods inherited from Dry::Validation::Schema
#[], checks, error_compiler, groups, hint_compiler, messages, predicates, #predicates, rules, schemas
Methods included from Definition
#confirmation, #key, #optional, #rule, #schema
Constructor Details
#initialize ⇒ Form
Returns a new instance of Form.
9 10 11 12 |
# File 'lib/dry/validation/schema/form.rb', line 9 def initialize super @input_type = InputTypeCompiler.new.(self.class.rules.map(&:to_ary)) end |
Instance Attribute Details
#input_type ⇒ Object (readonly)
Returns the value of attribute input_type.
7 8 9 |
# File 'lib/dry/validation/schema/form.rb', line 7 def input_type @input_type end |
Instance Method Details
#call(input) ⇒ Object
14 15 16 |
# File 'lib/dry/validation/schema/form.rb', line 14 def call(input) super(input_type[input]) end |