Class: Locomotive::ContentEntryPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Locomotive::ContentEntryPresenter
- Defined in:
- app/presenters/locomotive/content_entry_presenter.rb
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
-
#_label ⇒ Object
properties ##.
- #as_json_for_html_view ⇒ Object
-
#as_json_with_custom_fields ⇒ Object
other methods ##.
- #content_type_slug ⇒ Object
-
#errors ⇒ Object
other getters / setters ##.
- #safe_attributes ⇒ Object
-
#set_attributes ⇒ Object
callbacks ##.
Methods inherited from BasePresenter
#_id, #ability?, #after_initialize, #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
#_label ⇒ Object
properties ##
6 |
# File 'app/presenters/locomotive/content_entry_presenter.rb', line 6 properties :_label, only_getter: true |
#as_json_for_html_view ⇒ Object
51 52 53 54 |
# File 'app/presenters/locomotive/content_entry_presenter.rb', line 51 def as_json_for_html_view self.[:html_view] = true as_json_without_custom_fields.merge(self.custom_fields_to_hash) end |
#as_json_with_custom_fields ⇒ Object
other methods ##
45 46 47 |
# File 'app/presenters/locomotive/content_entry_presenter.rb', line 45 def as_json_with_custom_fields as_json_without_custom_fields.merge(self.custom_fields_to_hash) end |
#content_type_slug ⇒ Object
35 36 37 |
# File 'app/presenters/locomotive/content_entry_presenter.rb', line 35 def content_type_slug self.__source.content_type.slug end |
#errors ⇒ Object
other getters / setters ##
31 32 33 |
# File 'app/presenters/locomotive/content_entry_presenter.rb', line 31 def errors super end |
#safe_attributes ⇒ Object
39 40 41 |
# File 'app/presenters/locomotive/content_entry_presenter.rb', line 39 def safe_attributes self.__source.custom_fields_safe_setters + %w(_slug _visible seo_title meta_keywords meta_description) end |
#set_attributes ⇒ Object
callbacks ##
27 |
# File 'app/presenters/locomotive/content_entry_presenter.rb', line 27 set_callback :set_attributes, :after, :set_dynamic_attributes |