Class: Keinaufwand::Asset

Inherits:
Sync::Asset
  • Object
show all
Defined in:
lib/keinaufwand/asset.rb

Class Method Summary collapse

Class Method Details

.local_url_for(source_url) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/keinaufwand/asset.rb', line 6

def self.local_url_for(source_url)
  return if source_url.blank?
  return source_url unless asset_url?(source_url)

  key = key_for(source_url)
  exists?(key:) ? "#{Sync.configuration.local_asset_path_prefix}/#{key}" : source_url
end