Hikki::Adapters::RedisAdapter
A Redis adapter for Hikki.
It uses the redis
gem to communicate with Redis.
Installation
Add this line to your application's Gemfile:
gem 'hikki-redis'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hikki-redis
Usage
By default, the adapter will use Redis.new
as it's connection which uses the defaults in that gem.
You can pass in your own connection to use instead, useful for specifying a server and other options.
# Use the default connection
require 'redis_adapter'
adapter = Hikki::Adapters::RedisAdapter.new
# Use a specific connection
redis = Redis.new(:url => "redis://:[email protected]:6380/15")
adapter = Hikki::Adapters::RedisAdapter.new(redis)
If you do not specify an id
when saving, the adapter will generate a uuid using SecureRandom
.
Contributing
- Fork it ( http://github.com/originate/hikki/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Write your specifications
- Implement your specifications
- Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request