Class: Locomotive::EditableElementPresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/locomotive/editable_element_presenter.rb

Instance Attribute Summary

Attributes inherited from BasePresenter

#ability, #depth

Instance Method Summary collapse

Methods inherited from BasePresenter

#ability?, #after_initialize, getters_to_hash, #id, setters_to_hash, #site

Methods included from Presentable

#after_initialize, #as_json, #attributes=, #getters, #initialize, #property_options, #setters

Instance Method Details

#block_nameObject



22
23
24
25
26
27
28
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 22

def block_name
  if self.source.block
    self.labelize(self.source.block.split('/').last)
  else
    I18n.t('locomotive.pages.form.default_block')
  end
end

#labelObject

other getters / setters ##



14
15
16
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 14

def label
  self.labelize(self.slug)
end

#slugObject

properties ##



6
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 6

properties :slug, :block, :hint, :priority, :disabled, :from_parent, :allow_nil => true

#typeObject



18
19
20
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 18

def type
  self.source._type.to_s.demodulize
end