Module: RedisVoteable::ClassMethods

Defined in:
lib/redis_voteable.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_voteableObject

Specify a model as voteable.

Example: class Question < ActiveRecord::Base

acts_as_voteable

end



54
55
56
57
# File 'lib/redis_voteable.rb', line 54

def acts_as_voteable 
  RedisVoteable.redis ||= Redis.new(RedisVoteable.redis_voteable_settings)
  include Voteable
end

#acts_as_voterObject

Specify a model as voter.

Example: class User < ActiveRecord::Base

acts_as_voter

end



65
66
67
68
# File 'lib/redis_voteable.rb', line 65

def acts_as_voter
  RedisVoteable.redis ||= Redis.new(RedisVoteable.redis_voteable_settings)
  include Voter
end

#voteable?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/redis_voteable.rb', line 40

def voteable?
  false
end

#voter?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/redis_voteable.rb', line 44

def voter?
  false
end