Class: Locomotive::EditableElementPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Locomotive::EditableElementPresenter
- Defined in:
- app/presenters/locomotive/editable_element_presenter.rb
Direct Known Subclasses
EditableControlPresenter, EditableFilePresenter, EditableTextPresenter
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
- #block_name ⇒ Object
-
#label ⇒ Object
other getters / setters ##.
-
#slug ⇒ Object
properties ##.
- #type ⇒ Object
Methods inherited from BasePresenter
#_id, #ability?, #after_initialize, #errors, #formatted_time, getters_or_setters_to_hash, getters_to_hash, #html_view?, #include_errors?, setters_to_hash, #site, #true
Methods included from Presentable
#after_initialize, #as_json, #attributes=, #getters, #initialize, #property_options, #setters
Instance Method Details
#block_name ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 29 def block_name if self.__source.block self.labelize(self.__source.block.split('/').last) else I18n.t('locomotive.pages.form.default_block') end end |
#label ⇒ Object
other getters / setters ##
21 22 23 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 21 def label self.labelize(self.slug) end |
#slug ⇒ Object
properties ##
6 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 6 properties :slug, :block, allow_nil: true |
#type ⇒ Object
25 26 27 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 25 def type self.__source._type.to_s.demodulize end |