Sha256: f6f1ce1be10e722a742177abd6a86f580c485b1c6ca1297b28ed087e33c7fcf6
Contents?: true
Size: 1.2 KB
Versions: 6
Compression:
Stored size: 1.2 KB
Contents
module RocketChat # # Rocket.Chat Session # class Session # Server attr_reader :server # Session token attr_reader :token # # @param [Server] server Server # @param [Token] token Session token # def initialize(server, token) @server = server @token = token.dup.freeze end def request_json(path, options = {}) server.request_json path, options.merge(token: token) end # # logout REST API # @return [NilClass] # @raise [HTTPError, StatusError] # def logout request_json('/api/v1/logout', method: :post) nil end # # me REST API # @return [User] # @raise [HTTPError, StatusError] # def me User.new request_json('/api/v1/me', method: :get) end ### Message proxies def channels @channels ||= RocketChat::Messages::Channel.new(self) end def groups @groups ||= RocketChat::Messages::Group.new(self) end def users @users ||= RocketChat::Messages::User.new(self) end # # Settings messages proxy # @return [Messages::Settings] # def settings @settings ||= RocketChat::Messages::Settings.new(self) end end end
Version data entries
6 entries across 6 versions & 1 rubygems