README.md in easy_redis-0.0.2 vs README.md in easy_redis-0.0.3
- old
+ new
@@ -1,8 +1,8 @@
# EasyRedis
-Helper methods for activerecord objects to use redis easily
+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:
@@ -17,31 +17,37 @@
$ gem install easy_redis
## Usage
-Create a file under initializers directory and set a redis client like above:
+Create a file under initializers directory and set a redis client like below:
- EasyRedis::Redis.configure(:redis => Redis.new)
+ 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 = User.find(1) #sample ActiveRecord object
+ u.r_set("foo", "bar")
+ u.r_set_foo("bar")
+ u.redis_set("foo", "bar")
+ u.redis_set_foo("bar")
- u.r_get("key")
- u.redis_get("key")
- u.redis_get_key
+ u.r_get("foo")
+ u.r_get_foo
+ u.redis_get("foo")
+ u.redis_get_foo
- u.r_del("key")
- u.redis_del("key")
- u.redis_del_key
+ u.r_del("foo")
+ u.r_del_foo
+ u.redis_del("foo")
+ u.redis_del_foo
- u.r_update("key", "value")
- u.redis_update("key", "value")
- u.redis_update_key("value")
+ u.r_set_foo true
+ u.r_get_foo #returns true
+
+ u.r_set_foo 1
+ u.r_get_foo #returns 1
## Contributing
1. Fork it ( https://github.com/[my-github-username]/easy_redis/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)