Class: Locomotive::SitePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Locomotive::SitePresenter
- Defined in:
- app/presenters/locomotive/site_presenter.rb
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
-
#as_json_for_html_view ⇒ Object
custom as_json ##.
-
#domain_name ⇒ Object
other getters / setters ##.
- #memberships ⇒ Object
-
#name ⇒ Object
properties ##.
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
#as_json_for_html_view ⇒ Object
custom as_json ##
34 35 36 |
# File 'app/presenters/locomotive/site_presenter.rb', line 34 def as_json_for_html_view self.as_json(self.getters - %w(memberships)) end |
#domain_name ⇒ Object
other getters / setters ##
24 25 26 |
# File 'app/presenters/locomotive/site_presenter.rb', line 24 def domain_name Locomotive.config.domain end |
#memberships ⇒ Object
28 29 30 |
# File 'app/presenters/locomotive/site_presenter.rb', line 28 def memberships self.__source.memberships.map { |membership| membership.as_json(self.) } end |
#name ⇒ Object
properties ##
6 |
# File 'app/presenters/locomotive/site_presenter.rb', line 6 property :name |