Method: Awspec::Type::S3Bucket#has_object?

Defined in:
lib/awspec/type/s3_bucket.rb

#has_object?(key) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
# File 'lib/awspec/type/s3_bucket.rb', line 9

def has_object?(key)
  res = @s3_client.head_object({
                                 bucket: @id,
                                 key: key.sub(%r(\A/), '')
                               })
  res
rescue
  false
end