Sha256: 6c090333f4942a1409d2977bd04276e623b90a348d76bca107c4c11802d1e3eb

Contents?: true

Size: 490 Bytes

Versions: 2

Compression:

Stored size: 490 Bytes

Contents

module Slack
  module API
    class Users < Base
      def all(page: nil)
        responses = with_paging(page) do |pager|
          request :get, 'users.list', **pager.to_h
        end

        Slack::User.parse_all responses, 'members'
      end

      def find(id)
        response = request :get, 'users.info', user: id
        Slack::User.parse response, 'user'
      end

      def set_active
        with_nil_response { request :post, 'users.setActive' }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
laziness-0.2.6 lib/laziness/api/users.rb
laziness-0.2.5 lib/laziness/api/users.rb