Skip to content
/ dessert Public

A lightweight recommendation engine for Ruby apps using Redis

License

Notifications You must be signed in to change notification settings

mu29/dessert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dessert

A lightweight recommendation engine for Ruby apps using Redis. Inspired by DEVIEW presentation and recommendable gem.

Installation

Add this line to your application's Gemfile:

gem 'dessert'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dessert

Important Note

  • It is highly recommended to use background jobs like Resque or Sidekiq when calling like / unlike methods, because there is a bit of computation work.

  • Every rater and ratable items should have an id method.

  • Hidden items will not be recommended.

Usage

  1. Include Dessert::Rater on your User model.
class User
  include Dessert::Rater

  attr_accessor :id

  def initialize(id)
    @id = id
  end

  ...
end
  1. Define any class that can be rated.
class Movie
  attr_accessor :id

  def initialize(id)
    @id = id
  end
end
  1. Like, Unlike, Hide, Unhide items.
user = User.new(1)
movie = Movie.new(483)

user.like(movie)
user.unlike(movie)

user.hide(movie)
user.unhide(movie)
  1. Now recommend to users!
  user = User.new(1)
  user.recommended_for(klass: Movie, offset: 0, limit: 10)

Contributing

Bug reports and pull requests are welcome on GitHub.

Author

InJung Chung / @mu29

License

The gem is available as open source under the terms of the MIT License.

Releases

No releases published

Packages

No packages published