rokumatsumoto/boyutluseyler

View on GitHub
lib/object_storage/direct_upload/bucket.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

# Wrapper class for AWS::S3::Bucket

require_relative 'presigned_post'

module ObjectStorage
  module DirectUpload
    class Bucket
      attr_reader :bucket

      def initialize(bucket: DIRECT_UPLOAD_BUCKET)
        @bucket = bucket
      end

      delegate :object, to: :bucket

      def presigned_post(policy)
        PresignedPost.new(bucket, policy).create
      end
    end
  end
end