Class: Notifier::Base

Inherits:
Object
  • Object
show all
Includes:
ApplicationNotificationsHelper
Defined in:
app/notifiers/notifier/base.rb

Overview

The base class of notifiers. This is meant to be called by the Notifications Framework

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ApplicationNotificationsHelper

#notification_directory_path, #notification_view_path

Constructor Details

#initializeBase

:nodoc:


18
19
20
21
# File 'app/notifiers/notifier/base.rb', line 18

def initialize #:nodoc:
  super
  @pending_emails = []
end

Class Method Details

.method_missing(symbol, *args, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This is to allow client code to create notifications without explicitly instantiating notifiers


13
14
15
# File 'app/notifiers/notifier/base.rb', line 13

def method_missing(symbol, *args, &block)
  new.public_send(symbol, *args, &block)
end

Instance Method Details

#create_activity(options) ⇒ Object (protected)

Create an ActivityWrapper based on options

Parameters:

  • options (Hash)

    The options used to create an activity

Options Hash (options):

  • :actor (User)

    The actor who trigger off the activity

  • :object (Object)

    The object which the activity is about

  • :event (Symbol)

    The event name of activity


31
32
33
# File 'app/notifiers/notifier/base.rb', line 31

def create_activity(options)
  ActivityWrapper.new(self, Activity.new(options.merge(notifier_type: self.class.name)))
end