Class: Carrierwave::Nightcrawler::Swift::Storage::SwiftFile

Inherits:
Object
  • Object
show all
Defined in:
lib/carrierwave/nightcrawler/swift/storage.rb

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ SwiftFile

Returns a new instance of SwiftFile.



19
20
21
# File 'lib/carrierwave/nightcrawler/swift/storage.rb', line 19

def initialize(attrs)
  @attrs = attrs
end

Instance Method Details

#deleteObject



31
32
33
34
# File 'lib/carrierwave/nightcrawler/swift/storage.rb', line 31

def delete
  delete = NightcrawlerSwift::Delete.new
  delete.execute path
end

#pathObject



23
24
25
# File 'lib/carrierwave/nightcrawler/swift/storage.rb', line 23

def path
  @attrs["name"]
end

#url(options = {}) ⇒ Object



27
28
29
# File 'lib/carrierwave/nightcrawler/swift/storage.rb', line 27

def url(options = {})
  "#{NightcrawlerSwift.connection.public_url}/#{NightcrawlerSwift.options.bucket}/#{path}"
end