Sha256: c1fd59e8c1460f0ffb198304995d82be1aa1fef340bb2c8120c115a307ce2966

Contents?: true

Size: 563 Bytes

Versions: 4

Compression:

Stored size: 563 Bytes

Contents

module Panoptes
  class Client
    module UserGroups
      # Creates a new user group and puts the current user in it as the initial member.
      #
      # @see http://docs.panoptes.apiary.io/#reference/user-group/usergroup-collection/create-a-user-group
      # @param name [String] The name of the user group. Must be unique for the entirity of Zooniverse.
      # @return [Hash] The created user group.
      def create_user_group(name)
        post("/user_groups", user_groups: {
          name: name
        })["user_groups"][0]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
panoptes-client-0.2.1 lib/panoptes/client/user_groups.rb
panoptes-client-0.2.0 lib/panoptes/client/user_groups.rb
panoptes-client-0.1.2 lib/panoptes/client/user_groups.rb
panoptes-client-0.1.1 lib/panoptes/client/user_groups.rb