Class: AWS::S3::PresignedPost::ConditionBuilder
- Inherits:
-
Object
- Object
- AWS::S3::PresignedPost::ConditionBuilder
- Defined in:
- lib/aws/s3/presigned_post.rb
Overview
Lets you specify conditions on a field. See #where for usage examples.
Instance Method Summary collapse
-
#in(range) ⇒ Object
Specifies that the value of the field must be in the given range.
-
#is(value) ⇒ Object
Specifies that the value of the field must equal the provided value.
-
#starts_with(prefix) ⇒ Object
Specifies that the value of the field must begin with the provided value.
Instance Method Details
#in(range) ⇒ Object
Specifies that the value of the field must be in the given range. This may only be used to constrain the :content_length
field, e.g. presigned_post.with(:conent_length).in(1..4)
.
263 264 265 |
# File 'lib/aws/s3/presigned_post.rb', line 263 def in(range) @post.refine(:content_length => range) end |
#is(value) ⇒ Object
Specifies that the value of the field must equal the provided value.
232 233 234 235 236 237 238 |
# File 'lib/aws/s3/presigned_post.rb', line 232 def is(value) if @field == :content_length self.in(value) else @post.with_equality_condition(@field, value) end end |
#starts_with(prefix) ⇒ Object
Specifies that the value of the field must begin with the provided value. If you are specifying a condition on the “key” field, note that this check takes place after the ${filename} variable is expanded. This is only valid for the following fields:
-
:key
-
:cache_control
-
:content_type
-
:content_disposition
-
:content_encoding
-
:expires_header
-
:acl
-
:success_action_redirect
-
metadata fields (see AWS::S3::PresignedPost#where_metadata)
255 256 257 |
# File 'lib/aws/s3/presigned_post.rb', line 255 def starts_with(prefix) @post.with_prefix_condition(@field, prefix) end |