Module: Shrine::Plugins::AwsLambda
- Defined in:
- lib/shrine/plugins/aws_lambda.rb,
lib/shrine/plugins/aws_lambda/version.rb
Defined Under Namespace
Modules: AttacherClassMethods, AttacherMethods, ClassMethods
Constant Summary collapse
- SETTINGS =
{ access_key_id: :optional, callback_url: :required, convert_params: :optional, endpoint: :optional, log_formatter: :optional, log_level: :optional, logger: :optional, profile: :optional, region: :optional, retry_limit: :optional, secret_access_key: :optional, session_token: :optional, stub_responses: :optional, validate_params: :optional }.freeze
- Error =
Class.new(Shrine::Error)
- VERSION =
'0.2.1'
Class Method Summary collapse
-
.configure(uploader, settings = {}) ⇒ Object
If promoting was not yet overridden, it is set to automatically trigger Lambda processing defined in ‘Shrine#lambda_process`.
-
.load_dependencies(uploader, _opts = {}) ⇒ Object
It loads the backgrounding plugin, so that it can override promoting.
- .logger ⇒ Object
Class Method Details
.configure(uploader, settings = {}) ⇒ Object
If promoting was not yet overridden, it is set to automatically trigger Lambda processing defined in ‘Shrine#lambda_process`.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/shrine/plugins/aws_lambda.rb', line 28 def self.configure(uploader, settings = {}) SETTINGS.each do |key, value| raise Error, "The :#{key} option is required for Lambda plugin" if value == :required && settings[key].nil? uploader.opts[key] = settings.delete(key) if settings[key] end uploader.opts[:backgrounding_promote] = proc { lambda_process } return unless logger settings.each do |key, _value| logger.info "The :#{key} option is not supported by the Lambda plugin" end end |
.load_dependencies(uploader, _opts = {}) ⇒ Object
It loads the backgrounding plugin, so that it can override promoting.
55 56 57 |
# File 'lib/shrine/plugins/aws_lambda.rb', line 55 def self.load_dependencies(uploader, _opts = {}) uploader.plugin :backgrounding end |