Sha256: ba99718d0e9b58a9f5cc892c5779b62652cb9b5233fd8aba9124b4c97b7a988f

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

module Desk
  class Client
    # Defines methods related to groups
    module Group
      # Returns extended information of groups
      #
      #   @option options [Boolean, String, Integer]
      #   @example Return extended information for 12345
      #     Desk.groups
      #     Desk.groups(:count => 5)
      #     Desk.groups(:count => 5, :page => 3)
      # @format :json
      # @authenticated true
      # @see http://dev.desk.com/docs/api/groups
      def groups(*args)
        options = args.last.is_a?(Hash) ? args.pop : {}
        response = get("groups",options)
        response
      end

      # Returns extended information on a single group
      #
      #   @param id [Integer] a group ID
      #   @option options [Hash]
      #   @example Return extended information for 12345
      #     Desk.group(12345)
      # @format :json
      # @authenticated true
      # @see http://dev.desk.com/docs/api/groups/show
      def group(id)
        response = get("groups/#{id}")
        response.group
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
desk-0.3.3 lib/desk/client/group.rb
desk-0.3.2 lib/desk/client/group.rb