Class: S3Relay::UploadPresigner
- Defined in:
- lib/s3_relay/upload_presigner.rb
Instance Attribute Summary collapse
-
#expires ⇒ Object
readonly
Returns the value of attribute expires.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #form_data ⇒ Object
-
#initialize(options = {}) ⇒ UploadPresigner
constructor
A new instance of UploadPresigner.
Constructor Details
#initialize(options = {}) ⇒ UploadPresigner
Returns a new instance of UploadPresigner.
6 7 8 9 |
# File 'lib/s3_relay/upload_presigner.rb', line 6 def initialize(={}) @expires = ([:expires] || 1.minute.from_now).utc.xmlschema @uuid = SecureRandom.uuid end |
Instance Attribute Details
#expires ⇒ Object (readonly)
Returns the value of attribute expires.
4 5 6 |
# File 'lib/s3_relay/upload_presigner.rb', line 4 def expires @expires end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
4 5 6 |
# File 'lib/s3_relay/upload_presigner.rb', line 4 def uuid @uuid end |
Instance Method Details
#form_data ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/s3_relay/upload_presigner.rb', line 11 def form_data fields.keys.inject({}) { |h,k| h[k.downcase.underscore] = fields[k]; h } .merge( "endpoint" => endpoint, "policy" => encoded_policy, "signature" => signature, "uuid" => uuid ) end |