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_attachments ⇒ Object
- #mailer_cc ⇒ 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
- #restrict_api_response_fields ⇒ Object
-
#store_with_associated_records ⇒ Boolean
Returns whether activity_notification stores notification 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.
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/activity_notification/config.rb', line 255 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_cc = nil @mailer_attachments = 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 @restrict_api_response_fields = false end |
Instance Attribute Details
#action_cable_api_enabled ⇒ Boolean #action_cable_api_enabled=(value) ⇒ Boolean
205 206 207 |
# File 'lib/activity_notification/config.rb', line 205 def action_cable_api_enabled @action_cable_api_enabled end |
#action_cable_enabled ⇒ Boolean #action_cable_enabled=(value) ⇒ Boolean
196 197 198 |
# File 'lib/activity_notification/config.rb', line 196 def action_cable_enabled @action_cable_enabled end |
#action_cable_with_devise ⇒ Boolean #action_cable_with_devise=(value) ⇒ Boolean
214 215 216 |
# File 'lib/activity_notification/config.rb', line 214 def action_cable_with_devise @action_cable_with_devise end |
#active_job_queue ⇒ Symbol #active_job_queue=(value) ⇒ Symbol
173 174 175 |
# File 'lib/activity_notification/config.rb', line 173 def active_job_queue @active_job_queue end |
#composite_key_delimiter ⇒ String #composite_key_delimiter=(value) ⇒ Symbol
182 183 184 |
# File 'lib/activity_notification/config.rb', line 182 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
110 111 112 |
# File 'lib/activity_notification/config.rb', line 110 def mailer @mailer end |
#mailer_attachments ⇒ Hash, ... #mailer_attachments=(value) ⇒ Hash, ...
101 102 103 |
# File 'lib/activity_notification/config.rb', line 101 def @mailer_attachments end |
#mailer_cc ⇒ String, ... #mailer_cc=(value) ⇒ String, ...
92 93 94 |
# File 'lib/activity_notification/config.rb', line 92 def mailer_cc @mailer_cc 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
155 156 157 |
# File 'lib/activity_notification/config.rb', line 155 def mailer_templates_dir @mailer_templates_dir end |
#notification_api_channel_prefix ⇒ String #notification_api_channel_prefix=(value) ⇒ String
232 233 234 |
# File 'lib/activity_notification/config.rb', line 232 def notification_api_channel_prefix @notification_api_channel_prefix end |
#notification_channel_prefix ⇒ String #notification_channel_prefix=(value) ⇒ String
223 224 225 |
# File 'lib/activity_notification/config.rb', line 223 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
164 165 166 |
# File 'lib/activity_notification/config.rb', line 164 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
146 147 148 |
# File 'lib/activity_notification/config.rb', line 146 def parent_channel @parent_channel end |
#parent_controller ⇒ String #parent_controller=(value) ⇒ String
137 138 139 |
# File 'lib/activity_notification/config.rb', line 137 def parent_controller @parent_controller end |
#parent_job ⇒ String #parent_job=(value) ⇒ String
128 129 130 |
# File 'lib/activity_notification/config.rb', line 128 def parent_job @parent_job end |
#parent_mailer ⇒ String #parent_mailer=(value) ⇒ String
119 120 121 |
# File 'lib/activity_notification/config.rb', line 119 def parent_mailer @parent_mailer end |
#rescue_optional_target_errors ⇒ Boolean #rescue_optional_target_errors=(value) ⇒ Boolean
241 242 243 |
# File 'lib/activity_notification/config.rb', line 241 def rescue_optional_target_errors @rescue_optional_target_errors end |
#restrict_api_response_fields ⇒ Boolean #restrict_api_response_fields=(value) ⇒ Boolean
250 251 252 |
# File 'lib/activity_notification/config.rb', line 250 def restrict_api_response_fields @restrict_api_response_fields end |
#store_with_associated_records ⇒ Boolean
187 188 189 |
# File 'lib/activity_notification/config.rb', line 187 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
305 306 307 308 309 |
# File 'lib/activity_notification/config.rb', line 305 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
313 314 315 316 317 |
# File 'lib/activity_notification/config.rb', line 313 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 |
#subscription_table_name ⇒ String #subscription_table_name=(value) ⇒ String
35 36 37 |
# File 'lib/activity_notification/config.rb', line 35 def subscription_table_name @subscription_table_name end |