Class: Simpacker::Manifest

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

Defined Under Namespace

Classes: MissingEntryError, MissingFileError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Manifest

Returns a new instance of Manifest.



8
9
10
# File 'lib/simpacker/manifest.rb', line 8

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/simpacker/manifest.rb', line 6

def config
  @config
end

Instance Method Details

#lookup(*names) ⇒ Object



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

def lookup(*names)
  data.dig(*names.map(&:to_s))
end

#lookup!(*names) ⇒ Object



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

def lookup!(*names)
  lookup(*names) || handle_missing_entry(names)
end