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.
1138 1139 1140 1141 1142 1143 1144 1145 1146 |
# File 'lib/wamp/client/message.rb', line 1138 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.
1136 1137 1138 |
# File 'lib/wamp/client/message.rb', line 1136 def extra @extra end |
#signature ⇒ Object
Returns the value of attribute signature.
1136 1137 1138 |
# File 'lib/wamp/client/message.rb', line 1136 def signature @signature end |
Class Method Details
.parse(params) ⇒ Object
1152 1153 1154 1155 1156 1157 1158 1159 1160 |
# File 'lib/wamp/client/message.rb', line 1152 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
1148 1149 1150 |
# File 'lib/wamp/client/message.rb', line 1148 def self.type Types::AUTHENTICATE end |
Instance Method Details
#payload ⇒ Object
1162 1163 1164 1165 1166 1167 1168 1169 |
# File 'lib/wamp/client/message.rb', line 1162 def payload payload = [self.class.type] payload.push(self.signature) payload.push(self.extra) payload end |
#to_s ⇒ Object
1171 1172 1173 |
# File 'lib/wamp/client/message.rb', line 1171 def to_s 'AUTHENTICATE > ' + self.payload.to_s end |