Class: Formalist::RichText::EmbeddedFormsContainer::Registration

Inherits:
Object
  • Object
show all
Defined in:
lib/formalist/rich_text/embedded_forms_container/registration.rb

Constant Summary collapse

DEFAULT_INPUT_PROCESSOR =
-> input { input }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label:, form:, schema:, input_processor: DEFAULT_INPUT_PROCESSOR) ⇒ Registration

Returns a new instance of Registration.



12
13
14
15
16
17
# File 'lib/formalist/rich_text/embedded_forms_container/registration.rb', line 12

def initialize(label:, form:, schema:, input_processor: DEFAULT_INPUT_PROCESSOR)
  @label = label
  @form = form
  @schema = schema
  @input_processor = input_processor
end

Instance Attribute Details

#formObject (readonly)

Returns the value of attribute form.



8
9
10
# File 'lib/formalist/rich_text/embedded_forms_container/registration.rb', line 8

def form
  @form
end

#input_processorObject (readonly)

Returns the value of attribute input_processor.



10
11
12
# File 'lib/formalist/rich_text/embedded_forms_container/registration.rb', line 10

def input_processor
  @input_processor
end

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'lib/formalist/rich_text/embedded_forms_container/registration.rb', line 7

def label
  @label
end

#schemaObject (readonly)

Returns the value of attribute schema.



9
10
11
# File 'lib/formalist/rich_text/embedded_forms_container/registration.rb', line 9

def schema
  @schema
end

Instance Method Details

#to_hObject



19
20
21
22
23
24
25
26
# File 'lib/formalist/rich_text/embedded_forms_container/registration.rb', line 19

def to_h
  {
    label: label,
    form: form,
    schema: schema,
    input_processor: input_processor,
  }
end