Class: Ably::Models::AuthDetails

Inherits:
Object
  • Object
show all
Includes:
Ably::Modules::ModelCommon
Defined in:
lib/submodules/ably-ruby/lib/ably/models/auth_details.rb

Overview

AuthDetails are included in an AUTH ProtocolMessage#auth attribute to provide the realtime service with new token authentication details following a re-auth workflow

Instance Attribute Summary

Attributes included from Ably::Modules::ModelCommon

#hash

Instance Method Summary collapse

Methods included from Ably::Modules::ModelCommon

#==, #[], #as_json, included, #to_json, #to_s

Methods included from Ably::Modules::MessagePack

#to_msgpack

Constructor Details

#initialize(attributes = {}) ⇒ AuthDetails

Returns a new instance of AuthDetails.

Parameters:

  • attributes (Hash) (defaults to: {})

Options Hash (attributes):

  • :access_token (String)

    token string



26
27
28
29
# File 'lib/submodules/ably-ruby/lib/ably/models/auth_details.rb', line 26

def initialize(attributes = {})
  @hash_object = IdiomaticRubyWrapper(attributes.clone)
  self.attributes.freeze
end

Instance Method Details

#access_tokenString

The authentication token string.

Returns:

  • (String)


37
38
39
# File 'lib/submodules/ably-ruby/lib/ably/models/auth_details.rb', line 37

def access_token
  attributes[:access_token]
end

#attributesObject



41
42
43
# File 'lib/submodules/ably-ruby/lib/ably/models/auth_details.rb', line 41

def attributes
  @hash_object
end