Sha256: 0dc72e7c54d333a9b3dffbcda1f3aadab76e38c616bad6cdaec888eae2390f1c
Contents?: true
Size: 583 Bytes
Versions: 1
Compression:
Stored size: 583 Bytes
Contents
module Socialcastr class Comment < Base def like! api.post(element_path(:message_id => message_id) + "/likes") refresh return self end def unlike! api.delete(element_path(:message_id => message_id) + "/likes/#{like_id}") refresh return self end def unlikable_by?(api_id) self.likes.map{|l| l.unlikable_by?(api_id)}.any? end def likable_by?(api_id) self.user_id != api_id end def like_id self.likes.select { |like| like.unlikable_by?(api.profile.id) }.first.id end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
socialcastr-0.2.8 | lib/socialcastr/comment.rb |