Class: AssetFingerprinter::DigestFingerprint

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

Instance Method Summary collapse

Constructor Details

#initializeDigestFingerprint

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