Module: BetterStorage

Extended by:
ActiveSupport::Autoload
Defined in:
lib/better_storage.rb,
lib/better_storage/blob.rb,
lib/better_storage/railtie.rb,
lib/better_storage/version.rb,
lib/better_storage/attachment.rb,
lib/better_storage/s3_service_proxy.rb

Defined Under Namespace

Modules: Attachment, Blob, S3ServiceProxy Classes: Railtie

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (BetterStorage)

    the object that the method was called on



15
16
17
# File 'lib/better_storage.rb', line 15

def self.configure
  yield self
end

.public_url(key) ⇒ Object



19
20
21
22
23
24
# File 'lib/better_storage.rb', line 19

def self.public_url(key)
  url = URI.parse(s3_endpoint)
  url.path += '/' unless url.path[-1] == '/'
  url.path += key
  url.to_s
end