Class: WampClient::Message::Authenticate

Inherits:
Base
  • Object
show all
Defined in:
lib/wamp_client/message.rb

Overview

Authenticate The “AUTHENTICATE” message is used with certain Authentication Methods. A Client having received a challenge is expected to respond by sending a signature or token. Formats:

[AUTHENTICATE, Signature|string, Extra|dict]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Check

included

Constructor Details

#initialize(signature, extra) ⇒ Authenticate

Returns a new instance of Authenticate.



1216
1217
1218
1219
1220
1221
1222
1223
1224
# File 'lib/wamp_client/message.rb', line 1216

def initialize(signature, extra)

  self.class.check_string('signature', signature)
  self.class.check_dict('extra', extra)

  self.signature = signature
  self.extra = extra

end

Instance Attribute Details

#extraObject

Returns the value of attribute extra.



1214
1215
1216
# File 'lib/wamp_client/message.rb', line 1214

def extra
  @extra
end

#signatureObject

Returns the value of attribute signature.



1214
1215
1216
# File 'lib/wamp_client/message.rb', line 1214

def signature
  @signature
end

Class Method Details

.parse(params) ⇒ Object



1230
1231
1232
1233
1234
1235
1236
1237
1238
# File 'lib/wamp_client/message.rb', line 1230

def self.parse(params)

  self.check_gte('params list', 3, params.count)
  self.check_equal('message type', self.type, params[0])

  params.shift
  self.new(*params)

end

.typeObject



1226
1227
1228
# File 'lib/wamp_client/message.rb', line 1226

def self.type
  Types::AUTHENTICATE
end

Instance Method Details

#payloadObject



1240
1241
1242
1243
1244
1245
1246
1247
# File 'lib/wamp_client/message.rb', line 1240

def payload

  payload = [self.class.type]
  payload.push(self.signature)
  payload.push(self.extra)

  payload
end

#to_sObject



1249
1250
1251
# File 'lib/wamp_client/message.rb', line 1249

def to_s
  'AUTHENTICATE > ' + self.payload.to_s
end