Class: Webpacker::Digests
- Inherits:
-
Object
- Object
- Webpacker::Digests
- Defined in:
- lib/webpacker/digests.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ Digests
constructor
A new instance of Digests.
- #lookup(name) ⇒ Object
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 |