class CarrierWave::Storage::NosFile
Attributes
path[R]
Public Class Methods
new(uploader, base, path)
click to toggle source
# File lib/carrierwave/storage/nos_file.rb, line 6 def initialize(uploader, base, path) @uploader = uploader @base = base @path = URI.encode(path) end
Public Instance Methods
read()
click to toggle source
# File lib/carrierwave/storage/nos_file.rb, line 12 def read object = bucket.get(@path) @headers = object.headers object end
store(file)
click to toggle source
# File lib/carrierwave/storage/nos_file.rb, line 18 def store(file) bucket.put(@path, file) end
url(_opts = {})
click to toggle source
# File lib/carrierwave/storage/nos_file.rb, line 22 def url(_opts = {}) bucket.path_to_url(@path) end
Private Instance Methods
bucket()
click to toggle source
# File lib/carrierwave/storage/nos_file.rb, line 32 def bucket return @bucket if defined? @bucket @bucket = CarrierWave::Nos::Bucket.new(@uploader) end
headers()
click to toggle source
# File lib/carrierwave/storage/nos_file.rb, line 28 def headers @headers ||= {} end