Class: SewingKit::Webpack::Manifest::Base
- Inherits:
-
Object
- Object
- SewingKit::Webpack::Manifest::Base
show all
- Defined in:
- lib/sewing_kit/webpack/manifest/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
9
10
11
|
# File 'lib/sewing_kit/webpack/manifest/base.rb', line 9
def initialize
@metadata = nil
end
|
Instance Method Details
#clear_cache! ⇒ Object
13
14
15
|
# File 'lib/sewing_kit/webpack/manifest/base.rb', line 13
def clear_cache!
@metadata = nil
end
|
#manifest ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/sewing_kit/webpack/manifest/base.rb', line 17
def manifest
current_metadata = metadata
if current_metadata.is_a?(Array)
all_assets = current_metadata.flat_map do |data|
data["assets"]["all"].values
end
asset_hash = all_assets.each_with_index
.collect { |asset, index| [index, asset] }
.to_h
{
"all" => asset_hash,
}
else
current_metadata["assets"]
end
end
|