Class: SocialcastApi::Comment

Inherits:
Base
  • Object
show all
Defined in:
lib/socialcast-api/base.rb

Defined Under Namespace

Classes: Like

Instance Method Summary collapse

Instance Method Details

#likeObject



66
67
68
# File 'lib/socialcast-api/base.rb', line 66

def like
  Comment.post(id.to_s + '/likes')
end

#unlikeObject



70
71
72
73
74
75
76
# File 'lib/socialcast-api/base.rb', line 70

def unlike
  likedbyme = likes.select {|alike| alike.unlikable}.first
  if likedbyme
    likedbyme.prefix_options = {:message_id => message_id, :comment_id => self.id}
    likedbyme.destroy 
  end
end