Method: Github::Client::Orgs::Members#list

Defined in:
lib/github_api/client/orgs/members.rb

#list(*args) ⇒ Object Also known as: all

List members

List all users who are members of an organization. A member is a user that belongs to at least 1 team in the organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. Otherwise only public members are returned.

List public members

Members of an organization can choose to have their membership publicized or not.

Examples:

github = Github.new
github.orgs.members.list 'org-name'
github.orgs.members.list 'org-name' { |memb| ... }
github = Github.new
github.orgs.members.list 'org-name', public: true
github.orgs.members.list 'org-name', public: true { |memb| ... }

Parameters:

See Also:



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/github_api/client/orgs/members.rb', line 48

def list(*args)
  params = arguments(args, required: [:org_name]).params
  org_name = arguments.org_name

  response = if params.delete('public')
               get_request("/orgs/#{org_name}/public_members", params)
             else
               get_request("/orgs/#{org_name}/members", params)
             end
  return response unless block_given?
  response.each { |el| yield el }
end