Module: ActivityNotification::Notifier

Extended by:
ActiveSupport::Concern
Includes:
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

Instance Method Summary collapse

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.

Returns:

  • (Boolean)

    Always true



17
18
19
# File 'lib/activity_notification/models/concerns/notifier.rb', line 17

def available_as_notifier?
  true
end

.set_notifier_class_defaultsNilClass

Sets default values to notifier class fields.

Returns:

  • (NilClass)

    nil



23
24
25
26
# File 'lib/activity_notification/models/concerns/notifier.rb', line 23

def set_notifier_class_defaults
  self._printable_notifier_name = :printable_name
  nil
end

Instance Method Details

#printable_notifier_nameString

Returns printable notifier model name to show in view or email.

Returns:

  • (String)

    Printable notifier model name



31
32
33
# File 'lib/activity_notification/models/concerns/notifier.rb', line 31

def printable_notifier_name
  resolve_value(_printable_notifier_name)
end