class Propshaft::Resolver::Dynamic
Attributes
Public Class Methods
Source
# File lib/propshaft/resolver/dynamic.rb, line 5 def initialize(load_path:, prefix:) @load_path, @prefix = load_path, prefix end
Public Instance Methods
Source
# File lib/propshaft/resolver/dynamic.rb, line 15 def integrity(logical_path) hash_algorithm = load_path.integrity_hash_algorithm if hash_algorithm && (asset = find_asset(logical_path)) asset.integrity(hash_algorithm: hash_algorithm) end end
Source
# File lib/propshaft/resolver/dynamic.rb, line 23 def read(logical_path, options = {}) if asset = load_path.find(logical_path) asset.content(**options) end end
Source
# File lib/propshaft/resolver/dynamic.rb, line 9 def resolve(logical_path) if asset = find_asset(logical_path) File.join prefix, asset.digested_path end end
Private Instance Methods
Source
# File lib/propshaft/resolver/dynamic.rb, line 30 def find_asset(logical_path) load_path.find(logical_path) end