Class: HasHelpers::Resource::EmailPresenter
- Inherits:
-
RowPresenter
- Object
- BasePresenter
- RowPresenter
- HasHelpers::Resource::EmailPresenter
- Defined in:
- app/presenters/has_helpers/resource/email_presenter.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#wrapped_object ⇒ Object
Returns the value of attribute wrapped_object.
Attributes inherited from RowPresenter
#is_child, #is_primary, #is_section_header, #items, #template, #toggle
Attributes inherited from BasePresenter
Instance Method Summary collapse
Methods inherited from BasePresenter
#==, #error_on, #initialize, wrap, wrap_with_options
Methods included from Attributes
Constructor Details
This class inherits a constructor from HasHelpers::BasePresenter
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class HasHelpers::BasePresenter
Instance Attribute Details
#current_user ⇒ Object
Returns the value of attribute current_user.
4 5 6 |
# File 'app/presenters/has_helpers/resource/email_presenter.rb', line 4 def current_user @current_user end |
#wrapped_object ⇒ Object
Returns the value of attribute wrapped_object.
4 5 6 |
# File 'app/presenters/has_helpers/resource/email_presenter.rb', line 4 def wrapped_object @wrapped_object end |
Instance Method Details
#cells ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/presenters/has_helpers/resource/email_presenter.rb', line 14 def cells ::HasHelpers::Resource::CellPresenter.wrap([ { value: wrapped_object.address, service: service }, { value: wrapped_object.location, is_header: true, is_primary: wrapped_object.is_primary, primary_title: wrapped_object["primary_title"] || "Preferred Email" } ]) end |
#primary_title ⇒ Object
31 32 33 |
# File 'app/presenters/has_helpers/resource/email_presenter.rb', line 31 def primary_title wrapped_object["primary_title"] || "Preferred Email" end |
#service ⇒ Object
25 26 27 |
# File 'app/presenters/has_helpers/resource/email_presenter.rb', line 25 def service "mailto:#{wrapped_object.address}" end |
#subtitle ⇒ Object
10 11 12 |
# File 'app/presenters/has_helpers/resource/email_presenter.rb', line 10 def subtitle wrapped_object.location end |
#title ⇒ Object
6 7 8 |
# File 'app/presenters/has_helpers/resource/email_presenter.rb', line 6 def title wrapped_object.address end |