EasyRedis
Helper methods for activerecord objects to use redis easily Don't worry about the type casting. EasyRedis does type conversions!
Installation
Add this line to your application's Gemfile:
gem 'easy_redis'
And then execute:
$ bundle
Or install it yourself as:
$ gem install easy_redis
Usage
Create a file under initializers directory and set a redis client like above:
EasyRedis::Redis.configure(:redis => Redis.new)
Examples:
u = User.find(1)
u.r_set("key", "value")
u.redis_set("key", "value")
u.redis_set_key("value")
u.r_get("key")
u.redis_get("key")
u.redis_get_key
u.r_del("key")
u.redis_del("key")
u.redis_del_key
u.r_update("key", "value")
u.redis_update("key", "value")
u.redis_update_key("value")
Contributing
- Fork it ( https://github.com/[my-github-username]/easy_redis/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request