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