Class: Propshaft::Manifest::ManifestEntry

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

Overview

Represents a single entry in the asset manifest.

Each entry contains information about an asset including its logical path (the original path), digested path (the path with content hash), and optional integrity hash for security verification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logical_path:, digested_path:, integrity:) ⇒ ManifestEntry

Creates a new manifest entry.

Parameters

  • logical_path - The logical path of the asset

  • digested_path - The digested path of the asset

  • integrity - The integrity hash of the asset (optional)



22
23
24
25
26
# File 'lib/propshaft/manifest.rb', line 22

def initialize(logical_path:, digested_path:, integrity:) # :nodoc:
  @logical_path = logical_path
  @digested_path = digested_path
  @integrity = integrity
end

Instance Attribute Details

#digested_pathObject (readonly)

Returns the value of attribute digested_path.



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

def digested_path
  @digested_path
end

#integrityObject (readonly)

Returns the value of attribute integrity.



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

def integrity
  @integrity
end

#logical_pathObject (readonly)

Returns the value of attribute logical_path.



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

def logical_path
  @logical_path
end

Instance Method Details

#to_hObject

Converts the manifest entry to a hash representation.

Returns a hash containing the digested_path and integrity keys.



31
32
33
# File 'lib/propshaft/manifest.rb', line 31

def to_h
  { digested_path: digested_path, integrity: integrity}
end