Class: MailDude::Configuration
- Inherits:
-
Object
- Object
- MailDude::Configuration
- Defined in:
- lib/mail_dude/configuration.rb
Constant Summary collapse
- SUPPORTED_STORES =
%i[file memory database].freeze
Instance Attribute Summary collapse
-
#allow_production ⇒ Object
Returns the value of attribute allow_production.
-
#capture_attachments ⇒ Object
Returns the value of attribute capture_attachments.
-
#capture_mailer_metadata_headers ⇒ Object
Returns the value of attribute capture_mailer_metadata_headers.
-
#default_per_page ⇒ Object
Returns the value of attribute default_per_page.
-
#enabled_environments ⇒ Object
Returns the value of attribute enabled_environments.
-
#live_update_authorizer ⇒ Object
Returns the value of attribute live_update_authorizer.
-
#live_update_stream_name ⇒ Object
Returns the value of attribute live_update_stream_name.
-
#live_updates ⇒ Object
Returns the value of attribute live_updates.
-
#max_message_size ⇒ Object
Returns the value of attribute max_message_size.
-
#max_messages ⇒ Object
Returns the value of attribute max_messages.
-
#retention_period ⇒ Object
Returns the value of attribute retention_period.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#storage_path ⇒ Object
Returns the value of attribute storage_path.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mail_dude/configuration.rb', line 23 def initialize @enabled_environments = %w[development qa test] @storage = :file @storage_path = default_storage_path @max_messages = 1_000 @retention_period = 7.days @max_message_size = 25.megabytes @allow_production = false @capture_attachments = true @capture_mailer_metadata_headers = true @default_per_page = 50 @live_updates = false @live_update_stream_name = default_live_update_stream_name @live_update_authorizer = ->(_connection) { false } end |
Instance Attribute Details
#allow_production ⇒ Object
Returns the value of attribute allow_production.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def allow_production @allow_production end |
#capture_attachments ⇒ Object
Returns the value of attribute capture_attachments.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def @capture_attachments end |
#capture_mailer_metadata_headers ⇒ Object
Returns the value of attribute capture_mailer_metadata_headers.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def @capture_mailer_metadata_headers end |
#default_per_page ⇒ Object
Returns the value of attribute default_per_page.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def default_per_page @default_per_page end |
#enabled_environments ⇒ Object
Returns the value of attribute enabled_environments.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def enabled_environments @enabled_environments end |
#live_update_authorizer ⇒ Object
Returns the value of attribute live_update_authorizer.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def @live_update_authorizer end |
#live_update_stream_name ⇒ Object
Returns the value of attribute live_update_stream_name.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def live_update_stream_name @live_update_stream_name end |
#live_updates ⇒ Object
Returns the value of attribute live_updates.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def live_updates @live_updates end |
#max_message_size ⇒ Object
Returns the value of attribute max_message_size.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def @max_message_size end |
#max_messages ⇒ Object
Returns the value of attribute max_messages.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def @max_messages end |
#retention_period ⇒ Object
Returns the value of attribute retention_period.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def retention_period @retention_period end |
#storage ⇒ Object
Returns the value of attribute storage.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def storage @storage end |
#storage_path ⇒ Object
Returns the value of attribute storage_path.
9 10 11 |
# File 'lib/mail_dude/configuration.rb', line 9 def storage_path @storage_path end |
Instance Method Details
#validate! ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/mail_dude/configuration.rb', line 39 def validate! normalize! validate_storage! validate_storage_path! validate_positive!(:max_messages, ) validate_positive!(:retention_period, retention_period) validate_positive!(:max_message_size, ) validate_positive!(:default_per_page, default_per_page) validate_live_updates! self end |