Sha256: 8305c2217e5fee20e98d142bb35714d5f94173b089df99606e40907356897d05

Contents?: true

Size: 429 Bytes

Versions: 11

Compression:

Stored size: 429 Bytes

Contents

module Awspec::Type
  class S3 < Base
    attr_reader :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

11 entries across 11 versions & 1 rubygems

Version Path
awspec-0.8.0 lib/awspec/type/s3.rb
awspec-0.7.0 lib/awspec/type/s3.rb
awspec-0.6.4 lib/awspec/type/s3.rb
awspec-0.6.3 lib/awspec/type/s3.rb
awspec-0.6.2 lib/awspec/type/s3.rb
awspec-0.6.1 lib/awspec/type/s3.rb
awspec-0.6.0 lib/awspec/type/s3.rb
awspec-0.5.0 lib/awspec/type/s3.rb
awspec-0.4.1 lib/awspec/type/s3.rb
awspec-0.4.0 lib/awspec/type/s3.rb
awspec-0.3.0 lib/awspec/type/s3.rb