Class: WampClient::Message::Authenticate
- 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
-
#extra ⇒ Object
Returns the value of attribute extra.
-
#signature ⇒ Object
Returns the value of attribute signature.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(signature, extra) ⇒ Authenticate
constructor
A new instance of Authenticate.
- #payload ⇒ Object
- #to_s ⇒ Object
Methods included from Check
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
#extra ⇒ Object
Returns the value of attribute extra.
1179 1180 1181 |
# File 'lib/wamp_client/message.rb', line 1179 def extra @extra end |
#signature ⇒ Object
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 |
.type ⇒ Object
1191 1192 1193 |
# File 'lib/wamp_client/message.rb', line 1191 def self.type Types::AUTHENTICATE end |
Instance Method Details
#payload ⇒ Object
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_s ⇒ Object
1213 1214 1215 |
# File 'lib/wamp_client/message.rb', line 1213 def to_s 'AUTHENTICATE > ' + self.payload.to_s end |