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
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/active_interaction/modules/input_processor.rb', line 19 def process(inputs) inputs.stringify_keys.sort.each_with_object({}) do |(k, v), h| raise 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
15 16 17 |
# File 'lib/active_interaction/modules/input_processor.rb', line 15 def reserved?(name) name.to_s.start_with?('_interaction_') end |