Module: Yammer::Client::Feed
- Included in:
- Yammer::Client
- Defined in:
- lib/yammer/client/feed.rb
Overview
Defines methods related to feeds (or viewable messages)
Instance Method Summary collapse
-
#about_topic(id, options = {}) ⇒ Hashie::Mash
Messages that have the topic with given ID.
-
#direct_messages(options = {}) ⇒ Hashie::Mash
Private Messages (aka Direct Messages) for the logged-in user.
-
#messages(options = {}) ⇒ Hashie::Mash
Returns the 20 most recent messages in this network.
-
#messages_from(id, options = {}) ⇒ Hashie::Mash
Messages sent by the user with the given ID.
-
#messages_received(options = {}) ⇒ Hashie::Mash
Messages received by the logged-in user.
-
#messages_sent(options = {}) ⇒ Hashie::Mash
Returns the 20 sent messages by the current logged in user.
-
#my_feed(options = {}) ⇒ Hashie::Mash
Messages followed by the logged-in user.
-
#thread(id, options = {}) ⇒ Hashie::Mash
Messages in the thread with the given ID.
Instance Method Details
#about_topic(id, options = {}) ⇒ Hashie::Mash
Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.
Messages that have the topic with given ID. Corresponds to the messages on a topic's page on the website.
138 139 140 |
# File 'lib/yammer/client/feed.rb', line 138 def about_topic(id, ={}) response = get("messages/about_topic/#{id}", , :json) end |
#direct_messages(options = {}) ⇒ Hashie::Mash
Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.
Private Messages (aka Direct Messages) for the logged-in user. Corresponds to the "Direct Messages" section on the website.
79 80 81 |
# File 'lib/yammer/client/feed.rb', line 79 def (={}) response = get('messages/private', , :json) end |
#messages(options = {}) ⇒ Hashie::Mash
Developers should note that a strict rate limit is applied to all API requests, so clients should never poll for new messages more frequently than every 30 seconds to ensure that the user is still able to use the API for posting messages, etc.
Returns the 20 most recent messages in this network. Corresponds to the "Company Feed" tab on the website.
20 21 22 23 |
# File 'lib/yammer/client/feed.rb', line 20 def (={}) response = get('messages', ) format.to_s.downcase == 'xml' ? response['response']['messages'] : response end |
#messages_from(id, options = {}) ⇒ Hashie::Mash
Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.
Messages sent by the user with the given ID. Corresponds to the messages on a user profile page on the website.
118 119 120 |
# File 'lib/yammer/client/feed.rb', line 118 def (id, ={}) response = get("messages/from_user/#{id}", , :json) end |
#messages_received(options = {}) ⇒ Hashie::Mash
Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.
Messages received by the logged-in user. Corresponds to the "Received" tab on the website.
60 61 62 |
# File 'lib/yammer/client/feed.rb', line 60 def (={}) response = get('messages/received', , :json) end |
#messages_sent(options = {}) ⇒ Hashie::Mash
Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.
Returns the 20 sent messages by the current logged in user.
Alias for /api/v1/messages/from_user/logged-in_user_id.format
. Corresponds to the "Sent" tab on the website.
41 42 43 |
# File 'lib/yammer/client/feed.rb', line 41 def (={}) response = get('messages/sent', , :json) end |
#my_feed(options = {}) ⇒ Hashie::Mash
Important to note that the XML format returns a different structure than the JSON one. So we only support the JSON format for this method.
Messages followed by the logged-in user. Corresponds to the "My Feed" tab on the website.
98 99 100 |
# File 'lib/yammer/client/feed.rb', line 98 def my_feed(={}) response = get('messages/following', , :json) end |
#thread(id, options = {}) ⇒ Hashie::Mash
Does not accept the threaded parameter.
Messages in the thread with the given ID. Corresponds to the page you'd see when clicking on "in reply to" on the website.
157 158 159 160 |
# File 'lib/yammer/client/feed.rb', line 157 def thread(id, ={}) response = get("messages/in_thread/#{id}", ) format.to_s.downcase == 'xml' ? response['response']['messages'] : response end |