Class: Recommendable::Configuration
- Inherits:
-
Object
- Object
- Recommendable::Configuration
- Defined in:
- lib/recommendable/configuration.rb
Instance Attribute Summary collapse
-
#auto_enqueue ⇒ Object
Whether or not to automatically enqueue users to have their recommendations refreshed after they like/dislike an item.
-
#nearest_neighbors ⇒ Object
The number of nearest neighbors (k-NN) to check when updating recommendations for a user.
-
#orm ⇒ Object
The ORM you are using.
-
#queue_name ⇒ Object
The name of the queue that background jobs will be placed in.
-
#ratable_classes ⇒ Object
Returns the value of attribute ratable_classes.
-
#redis ⇒ Object
Recommendable’s connection to Redis.
-
#redis_namespace ⇒ Object
A prefix for all keys Recommendable uses.
-
#user_class ⇒ Object
Returns the value of attribute user_class.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Default values.
Constructor Details
#initialize ⇒ Configuration
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_enqueue ⇒ Object
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_neighbors ⇒ Object
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 |
#orm ⇒ Object
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_name ⇒ Object
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_classes ⇒ Object
Returns the value of attribute ratable_classes.
26 27 28 |
# File 'lib/recommendable/configuration.rb', line 26 def ratable_classes @ratable_classes end |
#redis ⇒ Object
Recommendable’s connection to Redis
9 10 11 |
# File 'lib/recommendable/configuration.rb', line 9 def redis @redis end |
#redis_namespace ⇒ Object
A prefix for all keys Recommendable uses
12 13 14 |
# File 'lib/recommendable/configuration.rb', line 12 def redis_namespace @redis_namespace end |
#user_class ⇒ Object
Returns the value of attribute user_class.
26 27 28 |
# File 'lib/recommendable/configuration.rb', line 26 def user_class @user_class end |