Module: ActivityNotification::Notifier
- Extended by:
- ActiveSupport::Concern
- Includes:
- Association, Common
- Defined in:
- lib/activity_notification/models/concerns/notifier.rb
Overview
Notifier implementation included in notifier model to be notified, like users or administrators.
Class Method Summary collapse
-
.available_as_notifier? ⇒ Boolean
Checks if the model includes notifier methods are available.
-
.set_notifier_class_defaults ⇒ NilClass
Sets default values to notifier class fields.
Instance Method Summary collapse
-
#printable_notifier_name ⇒ String
Returns printable notifier model name to show in view or email.
-
#sent_notifications ⇒ Array<Notificaion>, Mongoid::Criteria<Notificaion>
Has many sent notification instances from this notifier.
Methods included from Association
belongs_to_composite_xdb_record, belongs_to_polymorphic_xdb_record, filtered_by_association, has_many_composite_xdb_records, has_many_polymorphic_xdb_records, has_many_records, #update
Methods included from Common
#printable_name, #printable_type, #resolve_value, #to_class_name, #to_resource_name, #to_resources_name
Class Method Details
.available_as_notifier? ⇒ Boolean
Checks if the model includes notifier methods are available.
24 25 26 |
# File 'lib/activity_notification/models/concerns/notifier.rb', line 24 def available_as_notifier? true end |
.set_notifier_class_defaults ⇒ NilClass
Sets default values to notifier class fields.
30 31 32 33 |
# File 'lib/activity_notification/models/concerns/notifier.rb', line 30 def set_notifier_class_defaults self._printable_notifier_name = :printable_name nil end |
Instance Method Details
#printable_notifier_name ⇒ String
Returns printable notifier model name to show in view or email.
38 39 40 |
# File 'lib/activity_notification/models/concerns/notifier.rb', line 38 def printable_notifier_name resolve_value(_printable_notifier_name) end |
#sent_notifications ⇒ Array<Notificaion>, Mongoid::Criteria<Notificaion>
Has many sent notification instances from this notifier.
13 14 15 |
# File 'lib/activity_notification/models/concerns/notifier.rb', line 13 has_many_records :sent_notifications, class_name: "::ActivityNotification::Notification", as: :notifier |