Class: Decidim::PushNotificationPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Decidim::PushNotificationPresenter
- Defined in:
- decidim-core/app/presenters/decidim/push_notification_presenter.rb
Overview
Decorator for push notifications.
Instance Method Summary collapse
Instance Method Details
#body ⇒ Object
12 13 14 15 |
# File 'decidim-core/app/presenters/decidim/push_notification_presenter.rb', line 12 def body # Not using Rails sanitizers here because they escape HTML entities (i.e &) and we want to keep them Nokogiri::HTML(event_class_instance.notification_title).text if event_class_instance.notification_title.present? end |
#icon ⇒ Object
17 18 19 |
# File 'decidim-core/app/presenters/decidim/push_notification_presenter.rb', line 17 def icon user.organization.attached_uploader(:favicon).variant_url(:big, host: user.organization.host) end |
#title ⇒ Object
8 9 10 |
# File 'decidim-core/app/presenters/decidim/push_notification_presenter.rb', line 8 def title event_class.constantize.model_name.human end |
#url ⇒ Object
21 22 23 |
# File 'decidim-core/app/presenters/decidim/push_notification_presenter.rb', line 21 def url event_class_instance.resource_url end |