Module: Broi::Input::Soft
- Defined in:
- lib/broi/input/soft.rb
Class Method Summary collapse
Class Method Details
.[](klass) ⇒ Object
29 30 31 |
# File 'lib/broi/input/soft.rb', line 29 def [](klass) register[klass] end |
.call(input_class, attrs, errors) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/broi/input/soft.rb', line 42 def self.call(input_class, attrs, errors) attrs = input_class.input[attrs] input = Utils.deep_merge(attrs, errors) do |target, _error| InvalidValue.new(target) end input = Utils.deep_transform_values(input) do |value| value.is_a?(InvalidValue) ? value : Value.new(value) end self[input_class].new(input) end |