Class: Formalist::ChildForms::ParamsProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/formalist/child_forms/params_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(embedded_form_collection) ⇒ ParamsProcessor

Returns a new instance of ParamsProcessor.



9
10
11
# File 'lib/formalist/child_forms/params_processor.rb', line 9

def initialize(embedded_form_collection)
  @embedded_forms = embedded_form_collection
end

Instance Attribute Details

#embedded_formsObject (readonly)

Returns the value of attribute embedded_forms.



7
8
9
# File 'lib/formalist/child_forms/params_processor.rb', line 7

def embedded_forms
  @embedded_forms
end

Instance Method Details

#call(input) ⇒ Object Also known as: []



13
14
15
16
# File 'lib/formalist/child_forms/params_processor.rb', line 13

def call(input)
  return input if input.nil?
  input.inject([]) { |output, node| output.push(process(node)) }
end