Class: AnimalCracker::AssetHost

Inherits:
Object
  • Object
show all
Defined in:
lib/animalcracker/asset_host.rb

Overview

Generic asset hosting proxy. Will default to MemoryAssetHost unless configured otherwise

Class Method Summary collapse

Class Method Details

.[](*args) ⇒ Object



15
# File 'lib/animalcracker/asset_host.rb', line 15

def [](*args) asset_host.find(*args); end

.[]=(*args) ⇒ Object



16
# File 'lib/animalcracker/asset_host.rb', line 16

def []=(*args) asset_host.store(*args); end

.asset_hostObject



18
# File 'lib/animalcracker/asset_host.rb', line 18

def asset_host; @asset_host ||= MemoryAssetHost.new; end

.asset_host=(asset_host) ⇒ Object



19
# File 'lib/animalcracker/asset_host.rb', line 19

def asset_host=(asset_host) @asset_host = asset_host; end

.configure(configuration) ⇒ Object



10
11
12
13
# File 'lib/animalcracker/asset_host.rb', line 10

def configure(configuration)
  asset_path = configuration["asset_path"]
  self.asset_host = (asset_path == ":memory:") ? MemoryAssetHost.new : FileAssetHost.new(asset_path)
end