class RocketChat::Token

Rocket.Chat Token

Attributes

data[R]

Raw token data

Public Class Methods

new(data) click to toggle source

@param [Hash] data Raw token data

# File lib/rocket_chat/token.rb, line 14
def initialize(data)
  @data = Util.stringify_hash_keys data
end

Public Instance Methods

auth_token() click to toggle source

Authentication token

# File lib/rocket_chat/token.rb, line 19
def auth_token
  data['authToken']
end
inspect() click to toggle source
# File lib/rocket_chat/token.rb, line 28
def inspect
  format(
    '#<%<class_name>s:0x%<object_id>p @auth_token="%<auth_token>s", @user_id="%<user_id>s">',
    class_name: self.class.name,
    object_id: object_id,
    auth_token: auth_token,
    user_id: user_id
  )
end
user_id() click to toggle source

User ID

# File lib/rocket_chat/token.rb, line 24
def user_id
  data['userId']
end