Sha256: fcd504877c9f882e28e0ddcc5056fba5f56bed0263a21952819b487885722d7e
Contents?: true
Size: 1.1 KB
Versions: 37
Compression:
Stored size: 1.1 KB
Contents
module Ably::Models # Convert auth details attributes to a {AuthDetails} object # # @param attributes (see #initialize) # # @return [AuthDetails] def self.AuthDetails(attributes) case attributes when AuthDetails return attributes else AuthDetails.new(attributes || {}) end end # AuthDetails are included in an +AUTH+ {Ably::Models::ProtocolMessage#auth} attribute # to provide the realtime service with new token authentication details following a re-auth workflow # class AuthDetails include Ably::Modules::ModelCommon # @param attributes [Hash] # @option attributes [String] :access_token token string # def initialize(attributes = {}) @hash_object = IdiomaticRubyWrapper(attributes.clone) self.attributes.freeze end %w(access_token).each do |attribute| define_method attribute do attributes[attribute.to_sym] end end # @!attribute [r] attributes # @return [Hash] Access the token details Hash object ruby'fied to use symbolized keys def attributes @hash_object end end end
Version data entries
37 entries across 37 versions & 2 rubygems