Class: TypeStation::Blocks::Entity

Inherits:
Base
  • Object
show all
Defined in:
lib/type_station/blocks/entity.rb

Instance Attribute Summary

Attributes inherited from Base

#authorise, #model, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #render

Constructor Details

This class inherits a constructor from TypeStation::Blocks::Base

Instance Method Details

#dataObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/type_station/blocks/entity.rb', line 7

def data
  {
    action: options[:action],
    id: options[:model_id] || model.to_param,
    type: (options[:type] || model._type).to_s.classify,
    parent_id: options[:model_parent_id] || model.parent_id.to_s,
    fields: model_fields,
    values: model_values,
    create_url: options[:create_url],
    position: model.position,
    options: options[:options] || data_options
  }
end