class Recommendable::Configuration

Attributes

auto_enqueue[RW]

Whether or not to automatically enqueue users to have their recommendations refreshed after they like/dislike an item.

Default: true

furthest_neighbors[RW]

Like kNN, but also uses some number of most dissimilar users when updating recommendations for a user. Because, hey, disagreements are just as important as agreements, right? If `nearest_neighbors` is set to `nil`, this configuration is ignored. Set this to a lower number to improve Redis memory usage.

Default: nil

nearest_neighbors[RW]

The number of nearest neighbors (k-NN) to check when updating recommendations for a user. Set to `nil` if you want to check all neighbors as opposed to a subset of the nearest ones. Set this to a lower number to improve Redis memory usage.

Default: nil

orm[RW]

The ORM you are using. Currently supported: `:activerecord`, `:mongoid`, ':sequel', ':mongo-mapper' and `:datamapper`

ratable_classes[RW]
recommendations_to_store[RW]

The number of recommendations to store per user. Set this to a lower number to improve Redis memory usage.

Default: 100

redis[RW]

Recommendable's connection to Redis.

Default: localhost:6379/0

redis_namespace[RW]

A prefix for all keys Recommendable uses.

Default: recommendable

user_class[RW]

Public Class Methods

new() click to toggle source

Default values

# File lib/recommendable/configuration.rb, line 50
def initialize
  @redis                    = Redis.new
  @redis_namespace          = :recommendable
  @auto_enqueue             = true
  @ratable_classes          = []
  @nearest_neighbors        = nil
  @furthest_neihbors        = nil
  @recommendations_to_store = 100
end

Public Instance Methods

queue_name() click to toggle source
# File lib/recommendable/configuration.rb, line 60
def queue_name
  warn "Recommendable.config.queue_name has been deprecated. Jobs will always be placed in a queue named 'recommendable'."
end
queue_name=(queue_name) click to toggle source
# File lib/recommendable/configuration.rb, line 64
def queue_name=(queue_name)
  warn "Recommendable.config.queue_name has been deprecated. Jobs will always be placed in a queue named 'recommendable'."
end