Class: WebpackManifest::Manifest
- Inherits:
-
Object
- Object
- WebpackManifest::Manifest
- Defined in:
- lib/webpack_manifest/manifest.rb
Defined Under Namespace
Classes: 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.
12 13 14 15 |
# File 'lib/webpack_manifest/manifest.rb', line 12 def initialize(path, cache: false) @path = path @cache = cache end |
Instance Attribute Details
#cache=(value) ⇒ Object (writeonly)
Sets the attribute cache
10 11 12 |
# File 'lib/webpack_manifest/manifest.rb', line 10 def cache=(value) @cache = value end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/webpack_manifest/manifest.rb', line 9 def path @path end |
Instance Method Details
#assets ⇒ Object
25 26 27 |
# File 'lib/webpack_manifest/manifest.rb', line 25 def assets data.values end |
#cache_enabled? ⇒ Boolean
29 30 31 |
# File 'lib/webpack_manifest/manifest.rb', line 29 def cache_enabled? @cache end |
#find(name) ⇒ Object
21 22 23 |
# File 'lib/webpack_manifest/manifest.rb', line 21 def find(name) data[name.to_s] end |
#lookup!(name) ⇒ Object
17 18 19 |
# File 'lib/webpack_manifest/manifest.rb', line 17 def lookup!(name) find(name) || handle_missing_entry(name) end |