Class: Minipack::Manifest::Entry

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

Overview

A class that represents a single entry in a manifest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, integrity: nil) ⇒ Entry

Returns a new instance of Entry.

Parameters:

  • path (String)

    single path of a single entry

  • integrity (String, nil) (defaults to: nil)

    optional value for subresource integrity of script tags



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

def initialize(path, integrity: nil)
  @path = path
  @integrity = integrity
end

Instance Attribute Details

#integrityObject (readonly)

Returns the value of attribute integrity.



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

def integrity
  @integrity
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#==(other) ⇒ Object



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

def ==(other)
  @path == other.path && @integrity == other.integrity
end