Module: ActiveInteraction::InputProcessor
- Defined in:
- lib/active_interaction/modules/input_processor.rb
Overview
Groups inputs ending in “(*N*i)” into GroupedInput.
Class Method Summary collapse
Class Method Details
.process(inputs) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/active_interaction/modules/input_processor.rb', line 18 def process(inputs) inputs.stringify_keys.sort.each_with_object({}) do |(k, v), h| fail ReservedNameError, k.inspect if reserved?(k) if (match = GROUPED_INPUT_PATTERN.match(k)) assign_to_group!(h, *match.captures, v) else h[k.to_sym] = v end end end |
.reserved?(name) ⇒ Boolean
14 15 16 |
# File 'lib/active_interaction/modules/input_processor.rb', line 14 def reserved?(name) name.to_s.start_with?('_interaction_') end |