You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::S3::Presigner
- Inherits:
-
Object
- Object
- Aws::S3::Presigner
- Defined in:
- aws-sdk-core/lib/aws-sdk-core/s3/presigner.rb
Overview
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Presigner
constructor
A new instance of Presigner.
-
#presigned_url(method, params = {}) ⇒ Object
Constructor Details
Instance Method Details
#presigned_url(method, params = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'aws-sdk-core/lib/aws-sdk-core/s3/presigner.rb', line 44 def presigned_url(method, params = {}) if params[:key].nil? or params[:key] == '' raise ArgumentError, ":key must not be blank" end virtual_host = !!params.delete(:virtual_host) scheme = http_scheme(params, virtual_host) req = @client.build_request(method, params) use_bucket_as_hostname(req) if virtual_host sign_but_dont_send(req, expires_in(params), scheme) req.send_request.data end |