Class: PushType::StructureField

Inherits:
FieldType show all
Defined in:
app/fields/push_type/structure_field.rb

Instance Attribute Summary

Attributes inherited from FieldType

#model, #name

Instance Method Summary collapse

Methods inherited from FieldType

#css_class, #field_options, #form_helper, #html_options, #json_primitive, #json_value, #kind, #label, #multiple?, on_class, on_instance, options, #primitive, #template

Constructor Details

#initialize(*args, &block) ⇒ StructureField

Returns a new instance of StructureField.



7
8
9
10
# File 'app/fields/push_type/structure_field.rb', line 7

def initialize(*args, &block)
  super
  structure_class.class_eval(&block) if block
end

Instance Method Details

#fieldsObject



17
18
19
# File 'app/fields/push_type/structure_field.rb', line 17

def fields
  structure.fields
end

#valueObject



12
13
14
15
# File 'app/fields/push_type/structure_field.rb', line 12

def value
  structure.field_store = json_value unless json_value.blank?
  structure
end