Class: Webpack::Manifest::Entries

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

Defined Under Namespace

Classes: MissingEntryError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entries) ⇒ Entries

Returns a new instance of Entries.



12
13
14
# File 'lib/webpack/manifest/entries.rb', line 12

def initialize(entries)
  @entries = entries
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



10
11
12
# File 'lib/webpack/manifest/entries.rb', line 10

def entries
  @entries
end

Instance Method Details

#lookup(entry) ⇒ Object



16
17
18
# File 'lib/webpack/manifest/entries.rb', line 16

def lookup(entry)
  entries.fetch(entry) { nil }
end

#lookup!(entry) ⇒ Object



20
21
22
# File 'lib/webpack/manifest/entries.rb', line 20

def lookup!(entry)
  lookup(entry) || raise(MissingEntryError, "missing entry: #{entry}")
end