Sha256: 9fa2d2fda160c8bb3ab97c0e3c672b4aadec5b8a4b524365ab481ebc57f2a521

Contents?: true

Size: 324 Bytes

Versions: 6

Compression:

Stored size: 324 Bytes

Contents

module Socialcastr
  class Comment < Base
    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(api_id)
      self.likes.select { |like| like.unlikable_by?(api_id) }.first.id
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
socialcastr-0.2.5 lib/socialcastr/comment.rb
socialcastr-0.2.4 lib/socialcastr/comment.rb
socialcastr-0.2.3 lib/socialcastr/comment.rb
socialcastr-0.2.2 lib/socialcastr/comment.rb
socialcastr-0.2.1 lib/socialcastr/comment.rb
socialcastr-0.2.0 lib/socialcastr/comment.rb