Parent

Files

Class/Module Index [+]

Quicksearch

Moneta::Cache::DSL

@api private

Public Class Methods

new(store, &block) click to toggle source
# File lib/moneta/cache.rb, line 18
def initialize(store, &block)
  @store = store
  instance_eval(&block)
end

Public Instance Methods

adapter(store = nil, &block) click to toggle source

@api public

# File lib/moneta/cache.rb, line 24
def adapter(store = nil, &block)
  raise 'Adapter already set' if @store.adapter
  raise ArgumentError, 'Only argument or block allowed' if store && block
  @store.adapter = store || Moneta.build(&block)
end
cache(store = nil, &block) click to toggle source

@api public

# File lib/moneta/cache.rb, line 31
def cache(store = nil, &block)
  raise 'Cache already set' if @store.cache
  raise ArgumentError, 'Only argument or block allowed' if store && block
  @store.cache = store || Moneta.build(&block)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.