Sha256: d57b464c4b1ede17c1459908c2f51625929160697b3e2d8281da0ca45f6fe295
Contents?: true
Size: 938 Bytes
Versions: 5
Compression:
Stored size: 938 Bytes
Contents
module Socialcastr class Message < Base def flag! return true if flagged? self.flag = Socialcastr::Flag.parse(api.post(element_path + "/flags")) end def flagged? self.flag && !self.flag.id.nil? end def unflag! return unless flagged? api.delete(element_path + "/flags/#{self.flag.id}") self.flag = nil end def like! self.likes ||= [] likes << Like.parse(api.post(element_path + "/likes")) end def unlike! self.likes.reject! do |l| l.unlikable && api.delete(element_path + "/likes/#{l.id}") end end def comment!(arguments={}) comment = Socialcastr::Comment.new(arguments) api.post(element_path + "/comments", comment.to_params) end def self.search(query, arguments={}) xml = api.get(collection_path + "/search", { :q => query}.merge(arguments)) return parse(xml) end end end
Version data entries
5 entries across 5 versions & 1 rubygems