Class: Platforms::Yammer::Api::Subscriptions
- Defined in:
- lib/platforms/yammer/api/subscriptions.rb
Overview
Yammer’s subscription (following) management
Instance Method Summary collapse
-
#delete(options = {}, headers = {}) ⇒ Faraday::Response
Unsubscribe from a user or topic.
-
#post(body = nil, headers = {}) ⇒ Faraday::Response
Subscribe to a user or topic.
-
#to_topic(id, options = {}, headers = {}) ⇒ Faraday::Response
Check if the current user is subscribed to (following) a topic (hashtag).
-
#to_user(id, options = {}, headers = {}) ⇒ Faraday::Response
Check if the current user is subscribed to (following) another user.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Platforms::Yammer::Api::Base
Instance Method Details
#delete(options = {}, headers = {}) ⇒ Faraday::Response
Unsubscribe from a user or topic. This usually involves setting target_id and target_type in the options hash.
45 46 47 |
# File 'lib/platforms/yammer/api/subscriptions.rb', line 45 def delete ={}, headers={} @connection.delete "subscriptions.json", , headers end |
#post(body = nil, headers = {}) ⇒ Faraday::Response
Subscribe to a user or topic. This usually involves setting target_id and target_type in the JSON body.
35 36 37 |
# File 'lib/platforms/yammer/api/subscriptions.rb', line 35 def post body=nil, headers={} @connection.post "subscriptions.json", body, headers end |
#to_topic(id, options = {}, headers = {}) ⇒ Faraday::Response
Check if the current user is subscribed to (following) a topic (hashtag)
25 26 27 |
# File 'lib/platforms/yammer/api/subscriptions.rb', line 25 def to_topic id, ={}, headers={} @connection.get "subscriptions/to_topic/#{id}.json", , headers end |
#to_user(id, options = {}, headers = {}) ⇒ Faraday::Response
Check if the current user is subscribed to (following) another user
15 16 17 |
# File 'lib/platforms/yammer/api/subscriptions.rb', line 15 def to_user id, ={}, headers={} @connection.get "subscriptions/to_user/#{id}.json", , headers end |