Class: Mailscope::Configuration
- Inherits:
-
Object
- Object
- Mailscope::Configuration
- Defined in:
- lib/mailscope/configuration.rb
Overview
Runtime configuration. Set through Mailscope.configure.
Instance Attribute Summary collapse
-
#authenticate_with ⇒ Object
Callable receiving the ActionDispatch::Request.
-
#auto_refresh ⇒ Object
Polling for newly delivered mail, in the browser.
-
#auto_refresh_interval ⇒ Object
Polling for newly delivered mail, in the browser.
-
#block_remote_content ⇒ Object
Default state of the "block remote content" switch in the preview pane.
-
#default_theme ⇒ Object
:system, :light or :dark.
-
#location ⇒ Object
(also: #letters_location)
Where captured mail is stored.
-
#max_age ⇒ Object
Retention.
-
#max_letters ⇒ Object
Retention.
-
#preview_widths ⇒ Object
Widths offered by the viewport switcher, in CSS pixels.
-
#storage ⇒ Object
Storage adapter: a symbol registered in Mailscope::Storage, or an object responding to the Mailscope::Storage::Base interface.
-
#title ⇒ Object
Shown in the header and the
.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/mailscope/configuration.rb', line 36 def initialize @location = default_location @storage = :filesystem @max_letters = 500 @max_age = nil @authenticate_with = nil @block_remote_content = true @auto_refresh = false @auto_refresh_interval = 3 @default_theme = :system @title = 'Mailscope' @preview_widths = { 'Desktop' => nil, 'Tablet' => 768, 'Mobile' => 390 } end |
Instance Attribute Details
#authenticate_with ⇒ Object
Callable receiving the ActionDispatch::Request. Return a falsy value to deny access. Nil means the UI is open to anyone who can reach the route.
18 19 20 |
# File 'lib/mailscope/configuration.rb', line 18 def authenticate_with @authenticate_with end |
#auto_refresh ⇒ Object
Polling for newly delivered mail, in the browser. Off by default: the user turns it on from the header and the choice sticks per browser.
25 26 27 |
# File 'lib/mailscope/configuration.rb', line 25 def auto_refresh @auto_refresh end |
#auto_refresh_interval ⇒ Object
Polling for newly delivered mail, in the browser. Off by default: the user turns it on from the header and the choice sticks per browser.
25 26 27 |
# File 'lib/mailscope/configuration.rb', line 25 def auto_refresh_interval @auto_refresh_interval end |
#block_remote_content ⇒ Object
Default state of the "block remote content" switch in the preview pane.
21 22 23 |
# File 'lib/mailscope/configuration.rb', line 21 def block_remote_content @block_remote_content end |
#default_theme ⇒ Object
:system, :light or :dark. The user can override it in the UI.
28 29 30 |
# File 'lib/mailscope/configuration.rb', line 28 def default_theme @default_theme end |
#location ⇒ Object Also known as: letters_location
Where captured mail is stored. Accepts anything Pathname() understands.
7 8 9 |
# File 'lib/mailscope/configuration.rb', line 7 def location @location end |
#max_age ⇒ Object
Retention. Both are applied after every delivery; nil disables the check.
14 15 16 |
# File 'lib/mailscope/configuration.rb', line 14 def max_age @max_age end |
#max_letters ⇒ Object
Retention. Both are applied after every delivery; nil disables the check.
14 15 16 |
# File 'lib/mailscope/configuration.rb', line 14 def max_letters @max_letters end |
#preview_widths ⇒ Object
Widths offered by the viewport switcher, in CSS pixels.
34 35 36 |
# File 'lib/mailscope/configuration.rb', line 34 def preview_widths @preview_widths end |
#storage ⇒ Object
Storage adapter: a symbol registered in Mailscope::Storage, or an object responding to the Mailscope::Storage::Base interface.
11 12 13 |
# File 'lib/mailscope/configuration.rb', line 11 def storage @storage end |
#title ⇒ Object
Shown in the header and the
31 32 33 |
# File 'lib/mailscope/configuration.rb', line 31 def title @title end |