Class: Backframe::ImageCache::Base
- Inherits:
- 
      Object
      
        - Object
- Backframe::ImageCache::Base
 
- Defined in:
- lib/backframe/image_cache/image_cache.rb
Instance Method Summary collapse
- #asset(filepath, conversions) ⇒ Object
- #cached(filepath, conversions) ⇒ Object
- #cdn_url(filepath, conversions) ⇒ Object
- #http_cdn_url(filepath, conversions) ⇒ Object
- #http_url(filepath, conversions) ⇒ Object
- #path(filepath, conversions) ⇒ Object
- #url(filepath, conversions) ⇒ Object
Instance Method Details
#asset(filepath, conversions) ⇒ Object
| 11 12 13 | # File 'lib/backframe/image_cache/image_cache.rb', line 11 def asset(filepath, conversions) Backframe::ImageCache::Asset.new(filepath, conversions).process end | 
#cached(filepath, conversions) ⇒ Object
| 15 16 17 | # File 'lib/backframe/image_cache/image_cache.rb', line 15 def cached(filepath, conversions) Backframe::ImageCache::Cache.new(filepath, conversions).process end | 
#cdn_url(filepath, conversions) ⇒ Object
| 33 34 35 | # File 'lib/backframe/image_cache/image_cache.rb', line 33 def cdn_url(filepath, conversions) Rails.application.config.cdn_url + path(filepath, conversions) end | 
#http_cdn_url(filepath, conversions) ⇒ Object
| 37 38 39 | # File 'lib/backframe/image_cache/image_cache.rb', line 37 def http_cdn_url(filepath, conversions) cdn_url(filepath, conversions).gsub('https', 'http') end | 
#http_url(filepath, conversions) ⇒ Object
| 29 30 31 | # File 'lib/backframe/image_cache/image_cache.rb', line 29 def http_url(filepath, conversions) url(filepath, conversions).gsub('https', 'http') end | 
#path(filepath, conversions) ⇒ Object
| 19 20 21 22 23 | # File 'lib/backframe/image_cache/image_cache.rb', line 19 def path(filepath, conversions) string = Backframe::ImageCache::Conversions.new(conversions).to_s filekey = filepath || 'default.jpg' "/imagecache/#{string}/#{filekey}" end | 
#url(filepath, conversions) ⇒ Object
| 25 26 27 | # File 'lib/backframe/image_cache/image_cache.rb', line 25 def url(filepath, conversions) Rails.application.config.root_url + path(filepath, conversions) end |