Class: WebpackManifest::Manifest
- Inherits:
-
Object
- Object
- WebpackManifest::Manifest
- Defined in:
- lib/webpack_manifest/manifest.rb
Defined Under Namespace
Classes: FileNotFoundError, MissingEntryError
Instance Attribute Summary collapse
-
#cache ⇒ Object
writeonly
Sets the attribute cache.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #assets ⇒ Object
- #cache_enabled? ⇒ Boolean
- #find(name) ⇒ Object
-
#initialize(path, cache: false) ⇒ Manifest
constructor
A new instance of Manifest.
- #lookup!(name) ⇒ Object
Constructor Details
#initialize(path, cache: false) ⇒ Manifest
Returns a new instance of Manifest.
15 16 17 18 |
# File 'lib/webpack_manifest/manifest.rb', line 15 def initialize(path, cache: false) @path = path.to_s @cache = cache end |
Instance Attribute Details
#cache=(value) ⇒ Object (writeonly)
Sets the attribute cache
13 14 15 |
# File 'lib/webpack_manifest/manifest.rb', line 13 def cache=(value) @cache = value end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/webpack_manifest/manifest.rb', line 12 def path @path end |
Instance Method Details
#assets ⇒ Object
28 29 30 |
# File 'lib/webpack_manifest/manifest.rb', line 28 def assets data.values end |
#cache_enabled? ⇒ Boolean
32 33 34 |
# File 'lib/webpack_manifest/manifest.rb', line 32 def cache_enabled? @cache end |
#find(name) ⇒ Object
24 25 26 |
# File 'lib/webpack_manifest/manifest.rb', line 24 def find(name) data[name.to_s] end |
#lookup!(name) ⇒ Object
20 21 22 |
# File 'lib/webpack_manifest/manifest.rb', line 20 def lookup!(name) find(name) || handle_missing_entry(name) end |