Sha256: caabc69ae2190428b9db32e90d2664a4a6d159170a798a20589a41068adf22be

Contents?: true

Size: 684 Bytes

Versions: 13

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

module RocketChat
  #
  # Rocket.Chat Token
  #
  class Token
    # Raw token data
    attr_reader :data

    #
    # @param [Hash] data Raw token data
    #
    def initialize(data)
      @data = Util.stringify_hash_keys data
    end

    # Authentication token
    def auth_token
      data['authToken']
    end

    # User ID
    def user_id
      data['userId']
    end

    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
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rocketchat-0.3.1 lib/rocket_chat/token.rb
rocketchat-0.2.7 lib/rocket_chat/token.rb
rocketchat-0.2.6 lib/rocket_chat/token.rb
rocketchat-0.2.5 lib/rocket_chat/token.rb
rocketchat-0.2.4 lib/rocket_chat/token.rb
rocketchat-0.2.3 lib/rocket_chat/token.rb
rocketchat-0.2.2 lib/rocket_chat/token.rb
rocketchat-0.2.1 lib/rocket_chat/token.rb
rocketchat-0.1.23 lib/rocket_chat/token.rb
rocketchat-0.1.22 lib/rocket_chat/token.rb
rocketchat-0.1.21 lib/rocket_chat/token.rb
rocketchat-0.1.20 lib/rocket_chat/token.rb
rocketchat-0.1.19 lib/rocket_chat/token.rb