Class: Wamp::Client::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.
1189 1190 1191 1192 1193 1194 1195 1196 1197 |
# File 'lib/wamp/client/message.rb', line 1189 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.
1187 1188 1189 |
# File 'lib/wamp/client/message.rb', line 1187 def extra @extra end |
#signature ⇒ Object
Returns the value of attribute signature.
1187 1188 1189 |
# File 'lib/wamp/client/message.rb', line 1187 def signature @signature end |
Class Method Details
.parse(params) ⇒ Object
1203 1204 1205 1206 1207 1208 1209 1210 1211 |
# File 'lib/wamp/client/message.rb', line 1203 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
1199 1200 1201 |
# File 'lib/wamp/client/message.rb', line 1199 def self.type Types::AUTHENTICATE end |
Instance Method Details
#payload ⇒ Object
1213 1214 1215 1216 1217 1218 1219 1220 |
# File 'lib/wamp/client/message.rb', line 1213 def payload payload = [self.class.type] payload.push(self.signature) payload.push(self.extra) payload end |
#to_s ⇒ Object
1222 1223 1224 |
# File 'lib/wamp/client/message.rb', line 1222 def to_s 'AUTHENTICATE > ' + self.payload.to_s end |