Class: Platforms::Yammer::Api::GroupMemberships

Inherits:
Base
  • Object
show all
Defined in:
lib/platforms/yammer/api/group_memberships.rb

Overview

Group memberships in Yammer

Author:

  • Benjamin Elias

Since:

  • 0.1.0

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Platforms::Yammer::Api::Base

Instance Method Details

#delete(group_id, options = {}, headers = {}) ⇒ Faraday::Response

Leave a Group

Parameters:

  • group_id (#to_s)

    ID of Group to leave

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

    Options for the request

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

    Additional headers to send with the request

Returns:

  • (Faraday::Response)

    the API response

See Also:

Since:

  • 0.1.0



26
27
28
29
# File 'lib/platforms/yammer/api/group_memberships.rb', line 26

def delete group_id, options={}, headers={}
  params = options.merge({group_id: group_id})
  @connection.delete 'group_memberships.json', params, headers
end

#post(group_id, options = {}, headers = {}) ⇒ Faraday::Response

Join a Group

Parameters:

  • group_id (#to_s)

    The ID of the Group to join

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

    Options for the request

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

    Additional headers to send with the request

Returns:

  • (Faraday::Response)

    the API response

See Also:

Since:

  • 0.1.0



15
16
17
18
# File 'lib/platforms/yammer/api/group_memberships.rb', line 15

def post group_id, options={}, headers={}
  body = options.merge({ group_id: group_id})
  @connection.post 'group_memberships.json', body, headers
end