Sha256: 6e16667029a1f428f4fab75cc5485152addd75f9b426847eeaa619797de07509

Contents?: true

Size: 441 Bytes

Versions: 4

Compression:

Stored size: 441 Bytes

Contents

module Awspec::Type
  class S3 < Base
    attr_reader :s3_client, :bucket

    def initialize(id)
      super
      @bucket = find_bucket(id)
      @id = id if @bucket
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
awspec-0.2.3 lib/awspec/type/s3.rb
awspec-0.2.2 lib/awspec/type/s3.rb
awspec-0.2.1 lib/awspec/type/s3.rb
awspec-0.2.0 lib/awspec/type/s3.rb