Class: BunBunBundle::Manifest::Entry

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#sriObject (readonly)

Returns the value of attribute sri

Returns:

  • (Object)

    the current value of sri



11
12
13
# File 'lib/bun_bun_bundle/manifest.rb', line 11

def sri
  @sri
end

#urlObject (readonly)

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



11
12
13
# File 'lib/bun_bun_bundle/manifest.rb', line 11

def url
  @url
end

Class Method Details

.from(value) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/bun_bun_bundle/manifest.rb', line 12

def self.from(value)
  value.is_a?(Hash) || raise(
    MigrationError,
    'Manifest predates bun_bun_bundle 0.13. Run: bun_bun_bundle build',
  )

  if (url = value['url']).nil? || url.empty?
    raise InvalidEntryError, "Manifest entry is missing 'url'"
  end

  new(url: url, sri: Array(value['sri']).freeze)
end