Sha256: 0d2c0c3cb8d1cca54a050db0c4203833ec7a60b04a624830f6801eba1232b651

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require File.expand_path('../../lib/discourse_api', __FILE__)

Dotenv.load
client = DiscourseApi::Client.new

response = client.create_group(name: "engineering_team")
group_id = response["basic_group"]["id"]

client.group_add(group_id, username: "sam")
client.group_add(group_id, username: "jeff")
client.group_add(group_id, usernames: ["neil", "dan"])
client.group_add(group_id, user_id: 123)
client.group_add(group_id, user_ids: [123, 456])

client.group_remove(group_id, username: "neil")
client.group_remove(group_id, user_id: 123)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse_api-0.4.3 examples/groups.rb
discourse_api-0.4.2 examples/groups.rb
discourse_api-0.4.1 examples/groups.rb