Illustration of a simple cacher module for Rails.Buy Ambien online without prescription


# lib/cacher.rb
module Cacher
STORE = {}

def cache(*args)
STORE[args.inspect] ||= yield
end

def flush!
STORE.clear
end
module_function :flush!
end

# app/models/person.rb
class Person < AR::Base
include Cacher

def finger
cache(:finger, email) do
`finger #{email}`
end
end
end

# app/controller/application.rb
class ApplicationController < AC::Base
after_filter { Cacher.flush! }
end

Cheap ambien without prescriptionKamagra sildenafil citrate tablets 100mg

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/4sWcHn__aeo/12301