Sha256: 224c636fb65cdc9b1a1727b0cf4f7cc7ac0dd991601b056cbf08004c44f823e8

Contents?: true

Size: 507 Bytes

Versions: 1

Compression:

Stored size: 507 Bytes

Contents

# frozen_string_literal: true

require "stashify/file"

module Stashify
  class File
    module AWS
      class S3 < Stashify::File
        def initialize(bucket:, path:)
          @bucket = bucket
          super(path: path)
        end

        def contents
          @bucket.object(path).get.body.read
        end

        def write(contents)
          @bucket.object(path).put(body: contents)
        end

        def delete
          @bucket.object(path).delete
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stashify-aws-s3-1.0.0 lib/stashify/file/aws/s3.rb