Class: Recommendable::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/recommendable/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Default values



29
30
31
32
33
34
35
36
# File 'lib/recommendable/configuration.rb', line 29

def initialize
  @redis             = Redis.new
  @redis_namespace   = :recommendable
  @auto_enqueue      = true
  @queue_name        = :recommendable
  @ratable_classes   = []
  @nearest_neighbors = nil
end

Instance Attribute Details

#auto_enqueueObject

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



16
17
18
# File 'lib/recommendable/configuration.rb', line 16

def auto_enqueue
  @auto_enqueue
end

#nearest_neighborsObject

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.



24
25
26
# File 'lib/recommendable/configuration.rb', line 24

def nearest_neighbors
  @nearest_neighbors
end

#ormObject

The ORM you are using. Currently supported: ‘:activerecord`, `:mongoid`, and `:datamapper`



6
7
8
# File 'lib/recommendable/configuration.rb', line 6

def orm
  @orm
end

#queue_nameObject

The name of the queue that background jobs will be placed in



19
20
21
# File 'lib/recommendable/configuration.rb', line 19

def queue_name
  @queue_name
end

#ratable_classesObject

Returns the value of attribute ratable_classes.



26
27
28
# File 'lib/recommendable/configuration.rb', line 26

def ratable_classes
  @ratable_classes
end

#redisObject

Recommendable’s connection to Redis



9
10
11
# File 'lib/recommendable/configuration.rb', line 9

def redis
  @redis
end

#redis_namespaceObject

A prefix for all keys Recommendable uses



12
13
14
# File 'lib/recommendable/configuration.rb', line 12

def redis_namespace
  @redis_namespace
end

#user_classObject

Returns the value of attribute user_class.



26
27
28
# File 'lib/recommendable/configuration.rb', line 26

def user_class
  @user_class
end