Class: S3::BucketHeadRequest
- Defined in:
- lib/s3/bucket_head_request.rb
Constant Summary
Constants inherited from Request
Request::AWS_ALGORITHM, Request::AWS_REQUEST, Request::SERVICE, Request::UNSIGNED_PAYLOAD
Instance Method Summary collapse
Methods inherited from Request
Constructor Details
This class inherits a constructor from S3::Request
Instance Method Details
#parse_response(response) ⇒ Object
15 16 17 |
# File 'lib/s3/bucket_head_request.rb', line 15 def parse_response( response ) { region: response.headers[ 'x-amz-bucket-region' ] } end |
#submit(bucket:) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/s3/bucket_head_request.rb', line 3 def submit( bucket: ) response = head( "/#{ bucket }" ) if response.status == 404 ResponseMethods.install( response, nil ) else build_result( response, BucketHeadResult ) do BucketHeadResult.new( parse_response( response ) ) end end end |