Class: Locomotive::SnippetPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Locomotive::SnippetPresenter
- Defined in:
- app/presenters/locomotive/snippet_presenter.rb
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
-
#as_json_for_html_view ⇒ Object
custom as_json ##.
-
#name ⇒ Object
properties ##.
-
#updated_at ⇒ Object
other getters / setters ##.
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
#as_json_for_html_view ⇒ Object
custom as_json ##
17 18 19 |
# File 'app/presenters/locomotive/snippet_presenter.rb', line 17 def as_json_for_html_view self.as_json(self.getters - %w(template)) end |
#name ⇒ Object
properties ##
6 |
# File 'app/presenters/locomotive/snippet_presenter.rb', line 6 properties :name, :slug, :template |
#updated_at ⇒ Object
other getters / setters ##
11 12 13 |
# File 'app/presenters/locomotive/snippet_presenter.rb', line 11 def updated_at I18n.l(self.source.updated_at, :format => :short) end |