Class: ActivityNotification::Config
- Inherits:
-
Object
- Object
- ActivityNotification::Config
- Defined in:
- lib/activity_notification/config.rb
Overview
Class used to initialize configuration object.
Instance Attribute Summary collapse
- #action_cable_api_enabled ⇒ Object
- #action_cable_enabled ⇒ Object
- #action_cable_with_devise ⇒ Object
- #active_job_queue ⇒ Object
- #composite_key_delimiter ⇒ Object
- #email_enabled ⇒ Object
- #enabled ⇒ Object
- #mailer ⇒ Object
- #mailer_sender ⇒ Object
- #mailer_templates_dir ⇒ Object
- #notification_api_channel_prefix ⇒ Object
- #notification_channel_prefix ⇒ Object
- #notification_table_name ⇒ Object
- #opened_index_limit ⇒ Object
-
# ⇒ Boolean
Returns ORM name for ActivityNotification (:active_record, :mongoid or :dynamodb).
- #parent_channel ⇒ Object
- #parent_controller ⇒ Object
- #parent_job ⇒ Object
- #parent_mailer ⇒ Object
- #rescue_optional_target_errors ⇒ Object
-
#store_with_associated_records ⇒ Boolean
Returns whether activity_notification stores notificaion records including associated records like target and notifiable.
- #subscribe_as_default ⇒ Object
-
#subscribe_to_email_as_default ⇒ Boolean
Returns default email subscription value to use when the subscription record does not configured.
-
#subscribe_to_optional_targets_as_default ⇒ Boolean
Returns default optional target subscription value to use when the subscription record does not configured.
- #subscription_enabled ⇒ Object
- #subscription_table_name ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
Initialize configuration for ActivityNotification.
Constructor Details
#initialize ⇒ Config
Initialize configuration for ActivityNotification. These configuration can be overridden in initializer.
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/activity_notification/config.rb', line 228 def initialize @enabled = true @orm = :active_record @notification_table_name = 'notifications' @subscription_table_name = 'subscriptions' @email_enabled = false @subscription_enabled = false @subscribe_as_default = true @subscribe_to_email_as_default = nil @subscribe_to_optional_targets_as_default = nil @mailer_sender = nil @mailer = 'ActivityNotification::Mailer' @parent_mailer = 'ActionMailer::Base' @parent_job = 'ActiveJob::Base' @parent_controller = 'ApplicationController' @parent_channel = 'ActionCable::Channel::Base' @mailer_templates_dir = 'activity_notification/mailer' @opened_index_limit = 10 @active_job_queue = :activity_notification @composite_key_delimiter = '#' @store_with_associated_records = false @action_cable_enabled = false @action_cable_api_enabled = false @action_cable_with_devise = false @notification_channel_prefix = 'activity_notification_channel' @notification_api_channel_prefix = 'activity_notification_api_channel' @rescue_optional_target_errors = true end |
Instance Attribute Details
#action_cable_api_enabled ⇒ Boolean #action_cable_api_enabled=(value) ⇒ Boolean
187 188 189 |
# File 'lib/activity_notification/config.rb', line 187 def action_cable_api_enabled @action_cable_api_enabled end |
#action_cable_enabled ⇒ Boolean #action_cable_enabled=(value) ⇒ Boolean
178 179 180 |
# File 'lib/activity_notification/config.rb', line 178 def action_cable_enabled @action_cable_enabled end |
#action_cable_with_devise ⇒ Boolean #action_cable_with_devise=(value) ⇒ Boolean
196 197 198 |
# File 'lib/activity_notification/config.rb', line 196 def action_cable_with_devise @action_cable_with_devise end |
#active_job_queue ⇒ Symbol #active_job_queue=(value) ⇒ Symbol
155 156 157 |
# File 'lib/activity_notification/config.rb', line 155 def active_job_queue @active_job_queue end |
#composite_key_delimiter ⇒ String #composite_key_delimiter=(value) ⇒ Symbol
164 165 166 |
# File 'lib/activity_notification/config.rb', line 164 def composite_key_delimiter @composite_key_delimiter end |
#email_enabled ⇒ Boolean #email_enabled=(value) ⇒ Boolean
44 45 46 |
# File 'lib/activity_notification/config.rb', line 44 def email_enabled @email_enabled end |
#enabled ⇒ Boolean #enabled=(value) ⇒ Boolean
17 18 19 |
# File 'lib/activity_notification/config.rb', line 17 def enabled @enabled end |
#mailer ⇒ String #mailer=(value) ⇒ String
92 93 94 |
# File 'lib/activity_notification/config.rb', line 92 def mailer @mailer end |
#mailer_sender ⇒ String #mailer_sender=(value) ⇒ String
83 84 85 |
# File 'lib/activity_notification/config.rb', line 83 def mailer_sender @mailer_sender end |
#mailer_templates_dir ⇒ String #mailer_templates_dir=(value) ⇒ String
137 138 139 |
# File 'lib/activity_notification/config.rb', line 137 def mailer_templates_dir @mailer_templates_dir end |
#notification_api_channel_prefix ⇒ String #notification_api_channel_prefix=(value) ⇒ String
214 215 216 |
# File 'lib/activity_notification/config.rb', line 214 def notification_api_channel_prefix @notification_api_channel_prefix end |
#notification_channel_prefix ⇒ String #notification_channel_prefix=(value) ⇒ String
205 206 207 |
# File 'lib/activity_notification/config.rb', line 205 def notification_channel_prefix @notification_channel_prefix end |
#notification_table_name ⇒ String #notification_table_name=(value) ⇒ String
26 27 28 |
# File 'lib/activity_notification/config.rb', line 26 def notification_table_name @notification_table_name end |
#opened_index_limit ⇒ Integer #opened_index_limit=(value) ⇒ Integer
146 147 148 |
# File 'lib/activity_notification/config.rb', line 146 def opened_index_limit @opened_index_limit end |
# ⇒ Boolean
8 9 10 |
# File 'lib/activity_notification/config.rb', line 8 def orm @orm end |
#parent_channel ⇒ String #parent_channel=(value) ⇒ String
128 129 130 |
# File 'lib/activity_notification/config.rb', line 128 def parent_channel @parent_channel end |
#parent_controller ⇒ String #parent_controller=(value) ⇒ String
119 120 121 |
# File 'lib/activity_notification/config.rb', line 119 def parent_controller @parent_controller end |
#parent_job ⇒ String #parent_job=(value) ⇒ String
110 111 112 |
# File 'lib/activity_notification/config.rb', line 110 def parent_job @parent_job end |
#parent_mailer ⇒ String #parent_mailer=(value) ⇒ String
101 102 103 |
# File 'lib/activity_notification/config.rb', line 101 def parent_mailer @parent_mailer end |
#rescue_optional_target_errors ⇒ Boolean #rescue_optional_target_errors=(value) ⇒ Boolean
223 224 225 |
# File 'lib/activity_notification/config.rb', line 223 def rescue_optional_target_errors @rescue_optional_target_errors end |
#store_with_associated_records ⇒ Boolean
169 170 171 |
# File 'lib/activity_notification/config.rb', line 169 def store_with_associated_records @store_with_associated_records end |
#subscribe_as_default ⇒ Boolean #default_subscription=(value) ⇒ Boolean
62 63 64 |
# File 'lib/activity_notification/config.rb', line 62 def subscribe_as_default @subscribe_as_default end |
#subscribe_to_email_as_default ⇒ Boolean
Returns default email subscription value to use when the subscription record does not configured
275 276 277 278 279 |
# File 'lib/activity_notification/config.rb', line 275 def subscribe_to_email_as_default return false unless @subscribe_as_default @subscribe_to_email_as_default.nil? ? @subscribe_as_default : @subscribe_to_email_as_default end |
#subscribe_to_optional_targets_as_default ⇒ Boolean
Returns default optional target subscription value to use when the subscription record does not configured
283 284 285 286 287 |
# File 'lib/activity_notification/config.rb', line 283 def subscribe_to_optional_targets_as_default return false unless @subscribe_as_default @subscribe_to_optional_targets_as_default.nil? ? @subscribe_as_default : @subscribe_to_optional_targets_as_default end |
#subscription_enabled ⇒ Boolean #subscription_enabled=(value) ⇒ Boolean
53 54 55 |
# File 'lib/activity_notification/config.rb', line 53 def subscription_enabled @subscription_enabled end |