RedissifyModel
TODO: Your gem name
[![Dependency Status][DS img]][Dependency Status] [![Coverage Status][CS img]][Coverage Status]
Description
It acts as a cache key value store for Sequel Models.
Installation
Add this line to your application's Gemfile:
gem 'redissify_model'
And then execute:
$ bundle
Or install it yourself as:
$ gem install redissify_model
Usage
Configuring
Create a file named redissify_model.rb
somewhere on autoload paths and add this line to configure your project name:
Redissify::Config.project_name = "your_project_name"
Model
Unfortunately it only supports Sequel Ruby ORM. I will update it soon to support ActiveRecord too.
Class TestModel < Sequel::Model
include Redissify
end
Get the Model instance quickly with Redis query
TestModel.get_redis_ins(id)
=> #<TestModel @values={:id=>1, :name=>"test", :age=>13}
Contributing
- Fork it ( https://github.com/[my-github-username]/redissify_model/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