Module: Recommendify

Defined in:
lib/recommendify/recommendify.rb

Defined Under Namespace

Modules: CCMatrix Classes: Base, CosineInputMatrix, InputMatrix, JaccardInputMatrix, Neighbor, SimilarityMatrix, SparseMatrix

Constant Summary collapse

DEFAULT_MAX_NEIGHBORS =
50
@@redis =
nil

Class Method Summary collapse

Class Method Details

.capitalize(str_or_sym) ⇒ Object



16
17
18
19
# File 'lib/recommendify/recommendify.rb', line 16

def self.capitalize(str_or_sym)
	str = str_or_sym.to_s.each_char.to_a
	str.first.upcase + str[1..-1].join("").downcase
end

.constantize(klass) ⇒ Object



21
22
23
# File 'lib/recommendify/recommendify.rb', line 21

def self.constantize(klass)
  Object.module_eval("Recommendify::#{klass}", __FILE__, __LINE__)
end

.redisObject



11
12
13
14
# File 'lib/recommendify/recommendify.rb', line 11

def self.redis
  return @@redis unless @@redis.nil?
  raise "redis not configured! - Recommendify.redis = Redis.new"
end

.redis=(redis) ⇒ Object



7
8
9
# File 'lib/recommendify/recommendify.rb', line 7

def self.redis=(redis)
  @@redis = redis
end