Class: SourceMonitor::Configuration::ImagesSettings
- Inherits:
-
Object
- Object
- SourceMonitor::Configuration::ImagesSettings
- Defined in:
- lib/source_monitor/configuration/images_settings.rb
Constant Summary collapse
- DEFAULT_MAX_DOWNLOAD_SIZE =
10 MB
10 * 1024 * 1024
- DEFAULT_DOWNLOAD_TIMEOUT =
seconds
30- DEFAULT_ALLOWED_CONTENT_TYPES =
%w[ image/jpeg image/png image/gif image/webp image/svg+xml ].freeze
Instance Attribute Summary collapse
-
#allowed_content_types ⇒ Object
Returns the value of attribute allowed_content_types.
-
#download_timeout ⇒ Object
Returns the value of attribute download_timeout.
-
#download_to_active_storage ⇒ Object
Returns the value of attribute download_to_active_storage.
-
#max_download_size ⇒ Object
Returns the value of attribute max_download_size.
Instance Method Summary collapse
- #download_enabled? ⇒ Boolean
-
#initialize ⇒ ImagesSettings
constructor
A new instance of ImagesSettings.
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ ImagesSettings
Returns a new instance of ImagesSettings.
21 22 23 |
# File 'lib/source_monitor/configuration/images_settings.rb', line 21 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/images_settings.rb', line 6 def allowed_content_types @allowed_content_types end |
#download_timeout ⇒ Object
Returns the value of attribute download_timeout.
6 7 8 |
# File 'lib/source_monitor/configuration/images_settings.rb', line 6 def download_timeout @download_timeout end |
#download_to_active_storage ⇒ Object
Returns the value of attribute download_to_active_storage.
6 7 8 |
# File 'lib/source_monitor/configuration/images_settings.rb', line 6 def download_to_active_storage @download_to_active_storage end |
#max_download_size ⇒ Object
Returns the value of attribute max_download_size.
6 7 8 |
# File 'lib/source_monitor/configuration/images_settings.rb', line 6 def max_download_size @max_download_size end |
Instance Method Details
#download_enabled? ⇒ Boolean
32 33 34 |
# File 'lib/source_monitor/configuration/images_settings.rb', line 32 def download_enabled? !!download_to_active_storage end |
#reset! ⇒ Object
25 26 27 28 29 30 |
# File 'lib/source_monitor/configuration/images_settings.rb', line 25 def reset! @download_to_active_storage = false @max_download_size = DEFAULT_MAX_DOWNLOAD_SIZE @download_timeout = DEFAULT_DOWNLOAD_TIMEOUT @allowed_content_types = DEFAULT_ALLOWED_CONTENT_TYPES.dup end |