Module: Yammer::Client::Messages

Included in:
Yammer::Client
Defined in:
lib/yammer/client/messages.rb

Overview

Defines methods related to manipulating messages

Instance Method Summary collapse

Instance Method Details

#update(message, options = {}) ⇒ Hashie::Mash

Note:

A status update with text identical to the authenticating user's current status will be ignored to prevent duplicates.

Creates a new message from the authenticating user

Examples:

Creates a new message for the authenticating user

Yammer.update("I just posted a status update via the Yammer Ruby Gem!")

Parameters:

  • body (String)

    The text of your message.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :in_reply_to_message_id (Integer)

    The ID of an existing message that the message is in reply to.

  • :group_id (Integer)

    The ID of the group in which this message belongs.

  • :replied_to_id (Integer)

    The message ID this message is in reply to, if applicable.

  • :direct_to_id (Integer)

    the ID of the user to which this message will be sent as a private message.

  • :broadcast (String)

    If true this message should be broadcasted to all users. Must be an admin

  • :topic*n* (Integer)

    Topics to apply to the message. Can use topic1 through topic20.

Returns:

  • (Hashie::Mash)

    The created message.

See Also:

Rate Limited:

  • false

Supported formats:

  • :json, :xml

Requires Authentication:

  • true



23
24
25
26
# File 'lib/yammer/client/messages.rb', line 23

def update(message, options={})
  response = post('messages', options.merge(:body => message))
  format.to_s.downcase == 'xml' ? response['response']['messages'] : response
end