Class: WebpackManifest::Manifest

Inherits:
Object
  • Object
show all
Defined in:
lib/webpack_manifest/manifest.rb

Defined Under Namespace

Classes: FileNotFoundError, MissingEntryError

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute cache to.



13
14
15
# File 'lib/webpack_manifest/manifest.rb', line 13

def cache=(value)
  @cache = value
end

#pathObject (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

#assetsObject



28
29
30
# File 'lib/webpack_manifest/manifest.rb', line 28

def assets
  data.values
end

#cache_enabled?Boolean

Returns:

  • (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