Class: Webpacker::Digests

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Digests

Returns a new instance of Digests.



18
19
20
21
# File 'lib/webpacker/digests.rb', line 18

def initialize(path)
  @path = path
  load
end

Class Method Details

.load(path) ⇒ Object



5
6
7
# File 'lib/webpacker/digests.rb', line 5

def load(path)
  self.instance = new(path)
end

.lookup(name) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/webpacker/digests.rb', line 9

def lookup(name)
  if instance
    instance.lookup(name)
  else
    raise "Webpacker::Digests.load(path) must be called first"
  end
end

Instance Method Details

#lookup(name) ⇒ Object



23
24
25
# File 'lib/webpacker/digests.rb', line 23

def lookup(name)
  @digests[name.to_s]
end