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.



1181
1182
1183
1184
1185
1186
1187
1188
1189
# File 'lib/wamp_client/message.rb', line 1181

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.



1179
1180
1181
# File 'lib/wamp_client/message.rb', line 1179

def extra
  @extra
end

#signatureObject

Returns the value of attribute signature.



1179
1180
1181
# File 'lib/wamp_client/message.rb', line 1179

def signature
  @signature
end

Class Method Details

.parse(params) ⇒ Object



1195
1196
1197
1198
1199
1200
1201
1202
1203
# File 'lib/wamp_client/message.rb', line 1195

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



1191
1192
1193
# File 'lib/wamp_client/message.rb', line 1191

def self.type
  Types::AUTHENTICATE
end

Instance Method Details

#payloadObject



1205
1206
1207
1208
1209
1210
1211
# File 'lib/wamp_client/message.rb', line 1205

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

  payload
end

#to_sObject



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

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