class Databasedotcom::Chatter::Message

A private message between two or more Users

Public Class Methods

reply(client, in_reply_to_message_id, text) click to toggle source

Send a reply to the message identified by in_reply_to_message_id with content text.

# File lib/databasedotcom/chatter/message.rb, line 17
def self.reply(client, in_reply_to_message_id, text)
  url = "/services/data/v#{client.version}/chatter/users/me/messages"
  response = client.http_post(url, nil, :text => text, :inReplyTo => in_reply_to_message_id)
  Message.new(client, response.body)
end
send_message(client, recipients, text) click to toggle source

Send a private message with the content text to each user in the recipients list.

# File lib/databasedotcom/chatter/message.rb, line 9
def self.send_message(client, recipients, text)
  url = "/services/data/v#{client.version}/chatter/users/me/messages"
  recipients = recipients.is_a?(Array) ? recipients : [recipients]
  response = client.http_post(url, nil, :text => text, :recipients => recipients.join(','))
  Message.new(client, response.body)
end

Public Instance Methods

reply(text) click to toggle source

Send a reply to this Message with content text.

# File lib/databasedotcom/chatter/message.rb, line 24
def reply(text)
  self.class.reply(self.client, self.id, text)
end