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



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

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

.service(type) ⇒ Object



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

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

Instance Method Details

#dig(level) ⇒ Object



32
33
34
# File 'app/models/flexite/entry.rb', line 32

def dig(level)
  send(level)
end

#t_nodeObject



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

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