Class: AssetFingerprinter::DigestFingerprint
- Inherits:
-
Object
- Object
- AssetFingerprinter::DigestFingerprint
- Defined in:
- lib/asset_fingerprinter.rb
Instance Method Summary collapse
- #call(path) ⇒ Object
-
#initialize ⇒ DigestFingerprint
constructor
Digests a file and returns the cachebusted path.
Constructor Details
#initialize ⇒ DigestFingerprint
Digests a file and returns the cachebusted path
6 7 8 |
# File 'lib/asset_fingerprinter.rb', line 6 def initialize @cache = Hash.new{ |hash,key| hash[key] = Digest::MD5.hexdigest(File.read(key)) } end |
Instance Method Details
#call(path) ⇒ Object
10 11 12 |
# File 'lib/asset_fingerprinter.rb', line 10 def call(path) @cache[path] end |