Class: Locomotive::SitePresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/locomotive/site_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

#as_json_for_html_viewObject

custom as_json ##



31
32
33
# File 'app/presenters/locomotive/site_presenter.rb', line 31

def as_json_for_html_view
  self.as_json(self.getters - %w(memberships))
end

#domain_nameObject

other getters / setters ##



21
22
23
# File 'app/presenters/locomotive/site_presenter.rb', line 21

def domain_name
  Locomotive.config.domain
end

#membershipsObject



25
26
27
# File 'app/presenters/locomotive/site_presenter.rb', line 25

def memberships
  self.source.memberships.map { |membership| membership.as_json(self.options) }
end

#nameObject

properties ##



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

property    :name