Class: Formalist::ChildForms::Builder

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

Constant Summary collapse

MissingFormDefinitionError =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(embedded_form_collection) ⇒ Builder

Returns a new instance of Builder.



10
11
12
# File 'lib/formalist/child_forms/builder.rb', line 10

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/builder.rb', line 7

def embedded_forms
  @embedded_forms
end

Instance Method Details

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



14
15
16
17
# File 'lib/formalist/child_forms/builder.rb', line 14

def call(input)
  return input if input.nil?
  input.map { |node| visit(node) }
end