Class: Imagecache::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/imagecache/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(*args) ⇒ Object



9
10
# File 'lib/imagecache/base.rb', line 9

def build(*args)
end

.process(path) ⇒ Object



12
13
14
# File 'lib/imagecache/base.rb', line 12

def process(path)
  new.process(path)
end

Instance Method Details

#process(path) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/imagecache/base.rb', line 18

def process(path)
  url = url_reader.read(path)
  if (original = source(url.assetpath))
    if (converted = converter.convert(original, url.conversions))
      newurl = url_writer.write(url.conversions, url.assetpath)
      filesystem.set(newurl, converted.data)
      return converted
    end
  end
  nil
end