Class: S3FileHandler::Bucket::Exists
- Inherits:
-
S3FileHandler::BaseOperation
- Object
- S3FileHandler::BaseOperation
- S3FileHandler::Bucket::Exists
- Defined in:
- lib/s3_file_handler/bucket/exists.rb
Instance Attribute Summary collapse
-
#bucket_name ⇒ Object
readonly
Returns the value of attribute bucket_name.
Attributes inherited from S3FileHandler::BaseOperation
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(bucket_name, client: S3FileHandler.client) ⇒ Exists
constructor
A new instance of Exists.
Constructor Details
#initialize(bucket_name, client: S3FileHandler.client) ⇒ Exists
Returns a new instance of Exists.
8 9 10 11 |
# File 'lib/s3_file_handler/bucket/exists.rb', line 8 def initialize(bucket_name, client: S3FileHandler.client) super(client: client) @bucket_name = bucket_name end |
Instance Attribute Details
#bucket_name ⇒ Object (readonly)
Returns the value of attribute bucket_name.
6 7 8 |
# File 'lib/s3_file_handler/bucket/exists.rb', line 6 def bucket_name @bucket_name end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/s3_file_handler/bucket/exists.rb', line 13 def execute client.head_bucket(bucket: bucket_name) true rescue Aws::S3::Errors::NotFound, Aws::S3::Errors::Forbidden false rescue Aws::S3::Errors::ServiceError => e false rescue StandardError => e false end |