Module: DirectWave::Uploader::Connection::ClassMethods

Defined in:
lib/directwave/uploader/connection.rb

Instance Method Summary collapse

Instance Method Details

#s3_connectionObject

If no argument is given, it will simply return the currently used storage engine.

Parameters

storage (Symbol, Class)

The storage engine to use for this uploader

Returns

Class

the storage engine to be used with this uploader



20
21
22
23
24
25
26
# File 'lib/directwave/uploader/connection.rb', line 20

def s3_connection
  self._s3_connection ||= AWS::S3.new(
    access_key_id: self.s3_access_key_id,
    secret_access_key: self.s3_secret_access_key,
    s3_endpoint: "s3-#{self.s3_region}.amazonaws.com"
  )
end

#s3_directoryObject



28
29
30
# File 'lib/directwave/uploader/connection.rb', line 28

def s3_directory
  self._s3_directory ||= s3_connection.buckets[self.s3_bucket]
end