module Recommendable::Ratable::Dislikable
Public Instance Methods
disliked_by()
click to toggle source
Fetch a list of users that have disliked this item.
@return [Array] a list of users that have disliked this item
# File lib/recommendable/ratable/dislikable.rb, line 7 def disliked_by Recommendable.query(Recommendable.config.user_class, disliked_by_ids) end
disliked_by_count()
click to toggle source
Get the number of users that have disliked this item
@return [Fixnum] the number of users that have disliked this item
# File lib/recommendable/ratable/dislikable.rb, line 14 def disliked_by_count Recommendable.redis.scard(Recommendable::Helpers::RedisKeyMapper.disliked_by_set_for(self.class, id)) end
disliked_by_ids()
click to toggle source
Get the IDs of users that have disliked this item.
@return [Array] the IDs of users that have disliked this item
# File lib/recommendable/ratable/dislikable.rb, line 21 def disliked_by_ids Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.disliked_by_set_for(self.class, id)) end