Class: PresentationDataEditor

Inherits:
Object
  • Object
show all
Defined in:
lib/components/presentation_data_editor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view_context, data, schema, form) ⇒ PresentationDataEditor

Expects a hash schema definition.

will probably come from presentation_data_template.schema


9
10
11
12
13
14
# File 'lib/components/presentation_data_editor.rb', line 9

def initialize(view_context, data, schema, form)
  @view = view_context
  @data = data
  @schema = schema
  @form = form
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/components/presentation_data_editor.rb', line 3

def data
  @data
end

#formObject (readonly)

Returns the value of attribute form.



5
6
7
# File 'lib/components/presentation_data_editor.rb', line 5

def form
  @form
end

#schemaObject (readonly)

Returns the value of attribute schema.



4
5
6
# File 'lib/components/presentation_data_editor.rb', line 4

def schema
  @schema
end

#viewObject (readonly)

Returns the value of attribute view.



2
3
4
# File 'lib/components/presentation_data_editor.rb', line 2

def view
  @view
end

Instance Method Details

#renderObject



16
17
18
# File 'lib/components/presentation_data_editor.rb', line 16

def render
  presentation_data_editor if schema.is_a? Array
end