Module: RedisVoteable::ClassMethods

Defined in:
lib/redis_voteable.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) acts_as_voteable

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

- (Object) acts_as_voter

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

- (Boolean) voteable?



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

def voteable?
  false
end

- (Boolean) voter?



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

def voter?
  false
end