Class: ActivityNotification::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/activity_notification/config.rb

Overview

Class used to initialize configuration object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Initialize configuration for ActivityNotification. These configuration can be overriden in initializer.



71
72
73
74
75
76
77
78
79
80
# File 'lib/activity_notification/config.rb', line 71

def initialize
  @enabled            = true
  @table_name         = 'notifications'
  @email_enabled      = false
  @mailer_sender      = nil
  @mailer             = 'ActivityNotification::Mailer'
  @parent_mailer      = 'ActionMailer::Base'
  @parent_controller  = 'ApplicationController'
  @opened_index_limit = 10
end

Instance Attribute Details

#email_enabledBoolean #email_enabled=(value) ⇒ Boolean

Overloads:

  • #email_enabledBoolean

    Returns Whether activity_notification sends notification email.

    Returns:

    • (Boolean)

      Whether activity_notification sends notification email.

  • #email_enabled=(value) ⇒ Boolean

    Sets the email_enabled

    Parameters:

    • email_enabled (Boolean)

      The new email_enabled

    Returns:

    • (Boolean)

      Whether activity_notification sends notification email.



26
27
28
# File 'lib/activity_notification/config.rb', line 26

def email_enabled
  @email_enabled
end

#enabledBoolean #enabled=(value) ⇒ Boolean

Overloads:

  • #enabledBoolean

    Returns Whether ActivityNotification is enabled.

    Returns:

    • (Boolean)

      Whether ActivityNotification is enabled.

  • #enabled=(value) ⇒ Boolean

    Sets the enabled

    Parameters:

    • enabled (Boolean)

      The new enabled

    Returns:

    • (Boolean)

      Whether ActivityNotification is enabled.



10
11
12
# File 'lib/activity_notification/config.rb', line 10

def enabled
  @enabled
end

#mailerString #mailer=(value) ⇒ String

Overloads:

  • #mailerString

    Returns Mailer class for email notification.

    Returns:

    • (String)

      Mailer class for email notification.

  • #mailer=(value) ⇒ String

    Sets the mailer

    Parameters:

    • mailer (String)

      The new mailer

    Returns:

    • (String)

      Mailer class for email notification.



42
43
44
# File 'lib/activity_notification/config.rb', line 42

def mailer
  @mailer
end

#mailer_senderString #mailer_sender=(value) ⇒ String

Overloads:

  • #mailer_senderString

    Returns Email address as sender of notification email.

    Returns:

    • (String)

      Email address as sender of notification email.

  • #mailer_sender=(value) ⇒ String

    Sets the mailer_sender

    Parameters:

    • mailer_sender (String)

      The new mailer_sender

    Returns:

    • (String)

      Email address as sender of notification email.



34
35
36
# File 'lib/activity_notification/config.rb', line 34

def mailer_sender
  @mailer_sender
end

#opened_index_limitInteger #opened_index_limit=(value) ⇒ Integer

Overloads:

  • #opened_index_limitInteger

    Returns Default limit to query for opened notifications.

    Returns:

    • (Integer)

      Default limit to query for opened notifications.

  • #opened_index_limit=(value) ⇒ Integer

    Sets the opened_index_limit

    Parameters:

    • opened_index_limit (Integer)

      The new opened_index_limit

    Returns:

    • (Integer)

      Default limit to query for opened notifications.



66
67
68
# File 'lib/activity_notification/config.rb', line 66

def opened_index_limit
  @opened_index_limit
end

#parent_controllerString #parent_controller=(value) ⇒ String

Overloads:

  • #parent_controllerString

    Returns Base controller class for notifications_controller.

    Returns:

    • (String)

      Base controller class for notifications_controller.

  • #parent_controller=(value) ⇒ String

    Sets the parent_controller

    Parameters:

    • parent_controller (String)

      The new parent_controller

    Returns:

    • (String)

      Base controller class for notifications_controller.



58
59
60
# File 'lib/activity_notification/config.rb', line 58

def parent_controller
  @parent_controller
end

#parent_mailerString #parent_mailer=(value) ⇒ String

Overloads:

  • #parent_mailerString

    Returns Base mailer class for email notification.

    Returns:

    • (String)

      Base mailer class for email notification.

  • #parent_mailer=(value) ⇒ String

    Sets the parent_mailer

    Parameters:

    • parent_mailer (String)

      The new parent_mailer

    Returns:

    • (String)

      Base mailer class for email notification.



50
51
52
# File 'lib/activity_notification/config.rb', line 50

def parent_mailer
  @parent_mailer
end

#table_nameString #table_name=(value) ⇒ String

Overloads:

  • #table_nameString

    Returns Table name to store notifications.

    Returns:

    • (String)

      Table name to store notifications.

  • #table_name=(value) ⇒ String

    Sets the table_name

    Parameters:

    • table_name (String)

      The new table_name

    Returns:

    • (String)

      Table name to store notifications.



18
19
20
# File 'lib/activity_notification/config.rb', line 18

def table_name
  @table_name
end