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:, preview_image_url: nil, input_processor: DEFAULT_INPUT_PROCESSOR) ⇒ Registration



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

def initialize(label:, form:, schema:, preview_image_url: nil, input_processor: DEFAULT_INPUT_PROCESSOR)
  @label = label
  @form = form
  @schema = schema
  @input_processor = input_processor
  @preview_image_url = preview_image_url
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

#preview_image_urlObject (readonly)

Returns the value of attribute preview_image_url.



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

def preview_image_url
  @preview_image_url
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



21
22
23
24
25
26
27
28
29
# File 'lib/formalist/rich_text/embedded_forms_container/registration.rb', line 21

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