Class: AnimalCracker::AssetHost
- Inherits:
-
Object
- Object
- AnimalCracker::AssetHost
- Defined in:
- lib/animalcracker/asset_host.rb
Overview
Generic asset hosting proxy. Will default to MemoryAssetHost unless configured otherwise
Class Method Summary collapse
- .[](*args) ⇒ Object
- .[]=(*args) ⇒ Object
- .asset_host ⇒ Object
- .asset_host=(asset_host) ⇒ Object
- .configure(configuration) ⇒ Object
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_host ⇒ Object
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 |