Class: SourceMonitor::Configuration::FaviconsSettings
- Inherits:
-
Object
- Object
- SourceMonitor::Configuration::FaviconsSettings
- Defined in:
- lib/source_monitor/configuration/favicons_settings.rb
Constant Summary collapse
- DEFAULT_FETCH_TIMEOUT =
seconds
5- DEFAULT_MAX_DOWNLOAD_SIZE =
1 MB
1 * 1024 * 1024
- DEFAULT_RETRY_COOLDOWN_DAYS =
7- DEFAULT_ALLOWED_CONTENT_TYPES =
%w[ image/x-icon image/vnd.microsoft.icon image/png image/jpeg image/gif image/svg+xml image/webp ].freeze
Instance Attribute Summary collapse
-
#allowed_content_types ⇒ Object
Returns the value of attribute allowed_content_types.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#fetch_timeout ⇒ Object
Returns the value of attribute fetch_timeout.
-
#max_download_size ⇒ Object
Returns the value of attribute max_download_size.
-
#retry_cooldown_days ⇒ Object
Returns the value of attribute retry_cooldown_days.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ FaviconsSettings
constructor
A new instance of FaviconsSettings.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ FaviconsSettings
Returns a new instance of FaviconsSettings.
25 26 27 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 25 def initialize reset! end |
Instance Attribute Details
#allowed_content_types ⇒ Object
Returns the value of attribute allowed_content_types.
6 7 8 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 6 def allowed_content_types @allowed_content_types end |
#enabled ⇒ Object
Returns the value of attribute enabled.
6 7 8 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 6 def enabled @enabled end |
#fetch_timeout ⇒ Object
Returns the value of attribute fetch_timeout.
6 7 8 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 6 def fetch_timeout @fetch_timeout end |
#max_download_size ⇒ Object
Returns the value of attribute max_download_size.
6 7 8 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 6 def max_download_size @max_download_size end |
#retry_cooldown_days ⇒ Object
Returns the value of attribute retry_cooldown_days.
6 7 8 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 6 def retry_cooldown_days @retry_cooldown_days end |
Instance Method Details
#enabled? ⇒ Boolean
37 38 39 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 37 def enabled? !!enabled && !!defined?(ActiveStorage) end |
#reset! ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/source_monitor/configuration/favicons_settings.rb', line 29 def reset! @enabled = true @fetch_timeout = DEFAULT_FETCH_TIMEOUT @max_download_size = DEFAULT_MAX_DOWNLOAD_SIZE @retry_cooldown_days = DEFAULT_RETRY_COOLDOWN_DAYS @allowed_content_types = DEFAULT_ALLOWED_CONTENT_TYPES.dup end |