Class: JsonFields::BaseStructure

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::FormTagHelper, ActionView::Helpers::TagHelper
Defined in:
lib/json_fields/base_structure.rb

Direct Known Subclasses

ArraySimpleStructure, HashSimpleStructure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BaseStructure

Returns a new instance of BaseStructure.



9
10
11
# File 'lib/json_fields/base_structure.rb', line 9

def initialize(options)
  @allow_blank = options[:allow_blank] || false
end

Instance Attribute Details

#allow_blankObject

Returns the value of attribute allow_blank.



7
8
9
# File 'lib/json_fields/base_structure.rb', line 7

def allow_blank
  @allow_blank
end

Instance Method Details

#assemble(values) ⇒ Object



17
18
19
# File 'lib/json_fields/base_structure.rb', line 17

def assemble(values)
  raise "assemble must be defined in the subclass"
end

#template(object_name, method, options) ⇒ Object



13
14
15
# File 'lib/json_fields/base_structure.rb', line 13

def template(object_name, method, options)
  raise "template must be defined in the subclass"
end