Kue is a Rails ready key value store that uses active-record under the hood.
###What does Kue mean? K(eyVal)ue
###What about real key value stores? Redis is awesome! But sometimes you just don't want or need the external dependancy!
How do I install Kue?
Install the gem
gem install kue (command line) gem 'kue' (gemfile)
Run the generator
rails generate kue:install rake db:migrate
Set a key and it's value.
KueStore[:any_key_name_you_can_think_of] = "Any object you can dream up"
Get a value by key.
Don't worry it's not just string value's kue can store for you. It's anything!
KueStore[:my_class_instance] = Foo.new(:name => 1)
Find out if a key exists?
Delete a key and it's value
List all the keys in the KueStore
Clear all keys and values from the KueStore
Get a count of all the key/value pairs
###Don't like the KueStore class name?
No problem. Just include the Kue::Store module inside of your own class.
class MyStore < ActiveRecord::Base include Kue::Store end MyStore[:all_good] = 1