Class: Uploadcare::Rails::Configuration
- Inherits:
-
Object
- Object
- Uploadcare::Rails::Configuration
- Includes:
- Singleton
- Defined in:
- lib/uploadcare/rails/configuration.rb
Overview
A class for storing config parameters
Constant Summary collapse
- CONFIG_GLOBAL_PARAMS =
%w[ public_key secret_key cache_files cache_expires_in cache_namespace cdn_hostname store_files_after_save store_files_async delete_files_after_destroy delete_files_async ].freeze
- WIDGET_PARAMS =
%w[ public_key images_only preview_step crop image_shrink clearable tabs input_accept_types preferred_types system_dialog multipart_min_size preview_proxy cdn_base do_not_store audio_bits_per_second video_preferred_mime_types video_bits_per_second camera_mirror_default live manual_start locale locale_translations locale_pluralize ].freeze
Instance Method Summary collapse
Instance Method Details
#uploader_parameters ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/uploadcare/rails/configuration.rb', line 27 def uploader_parameters WIDGET_PARAMS.map do |param_name| param_value = instance_variable_get("@#{param_name}") next if param_value.nil? param_value = handle_param_value(param_value) "UPLOADCARE_#{param_name.upcase} = #{param_value};" end.compact.join("\n") end |
#widget ⇒ Object
37 38 39 40 41 |
# File 'lib/uploadcare/rails/configuration.rb', line 37 def Struct .new(WIDGET_PARAMS) .new(WIDGET_PARAMS.map { |param| public_send(param) }) end |