Class: Flexite::Entry

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
WithHistory
Defined in:
app/models/flexite/entry.rb,
app/forms/flexite/entry/array_form.rb,
app/services/flexite/entry/create_service.rb,
app/services/flexite/entry/destroy_service.rb,
app/services/flexite/entry/inner_processable.rb,
app/services/flexite/entry/array_create_service.rb,
app/services/flexite/entry/array_update_service.rb,
app/services/flexite/entry/destroy_array_entry_service.rb

Direct Known Subclasses

ArrEntry, BoolEntry, IntEntry, StrEntry, SymEntry

Defined Under Namespace

Modules: InnerProcessable Classes: ArrayCreateService, ArrayForm, ArrayUpdateService, CreateService, DestroyArrayEntryService, DestroyService, Form, UpdateService

Class Method Summary collapse

Instance Method Summary collapse

Methods included from WithHistory

#restore

Class Method Details

.form(attributes = {}) ⇒ Object



13
14
15
# File 'app/models/flexite/entry.rb', line 13

def self.form(attributes = {})
  Form.new(attributes)
end

.service(type) ⇒ Object



17
18
19
# File 'app/models/flexite/entry.rb', line 17

def self.service(type)
  "entry_#{type}".to_sym
end

Instance Method Details

#t_nodeObject



23
24
25
26
27
28
29
# File 'app/models/flexite/entry.rb', line 23

def t_node
  {
    'value' => self[:value],
    'type' => I18n.t("models.#{self.class.name.demodulize.underscore}"),
    'class' => self.class.name
  }
end