Class: Locomotive::MembershipPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Locomotive::MembershipPresenter
- Defined in:
- app/presenters/locomotive/membership_presenter.rb
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
- #can_update ⇒ Object
- #email ⇒ Object
- #grant_admin ⇒ Object
-
#name ⇒ Object
other getters / setters ##.
-
#role ⇒ Object
properties ##.
- #role_name ⇒ 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
#can_update ⇒ Object
26 27 28 29 |
# File 'app/presenters/locomotive/membership_presenter.rb', line 26 def can_update return nil unless self.ability? self.__ability.can? :update, self.__source end |
#email ⇒ Object
22 23 24 |
# File 'app/presenters/locomotive/membership_presenter.rb', line 22 def email self.__source.account.email end |
#grant_admin ⇒ Object
31 32 33 34 |
# File 'app/presenters/locomotive/membership_presenter.rb', line 31 def grant_admin return nil unless self.ability? self.__ability.can? :grant_admin, self.__source end |
#name ⇒ Object
other getters / setters ##
14 15 16 |
# File 'app/presenters/locomotive/membership_presenter.rb', line 14 def name self.__source.account.name end |
#role ⇒ Object
properties ##
6 |
# File 'app/presenters/locomotive/membership_presenter.rb', line 6 property :role |
#role_name ⇒ Object
18 19 20 |
# File 'app/presenters/locomotive/membership_presenter.rb', line 18 def role_name I18n.t("locomotive.memberships.roles.#{self.__source.role}") end |