Class: WampClient::Message::Challenge
- Defined in:
- lib/wamp_client/message.rb
Overview
Challenge The “CHALLENGE” message is used with certain Authentication Methods. During authenticated session establishment, a Router sends a challenge message. Formats:
[CHALLENGE, AuthMethod|string, Extra|dict]
Instance Attribute Summary collapse
-
#authmethod ⇒ Object
Returns the value of attribute authmethod.
-
#extra ⇒ Object
Returns the value of attribute extra.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(authmethod, extra) ⇒ Challenge
constructor
A new instance of Challenge.
- #payload ⇒ Object
- #to_s ⇒ Object
Methods included from Check
Constructor Details
#initialize(authmethod, extra) ⇒ Challenge
Returns a new instance of Challenge.
1170 1171 1172 1173 1174 1175 1176 1177 1178 |
# File 'lib/wamp_client/message.rb', line 1170 def initialize(authmethod, extra) self.class.check_string('authmethod', authmethod) self.class.check_dict('extra', extra) self.authmethod = authmethod self.extra = extra end |
Instance Attribute Details
#authmethod ⇒ Object
Returns the value of attribute authmethod.
1168 1169 1170 |
# File 'lib/wamp_client/message.rb', line 1168 def authmethod @authmethod end |
#extra ⇒ Object
Returns the value of attribute extra.
1168 1169 1170 |
# File 'lib/wamp_client/message.rb', line 1168 def extra @extra end |
Class Method Details
.parse(params) ⇒ Object
1184 1185 1186 1187 1188 1189 1190 1191 1192 |
# File 'lib/wamp_client/message.rb', line 1184 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 |
Instance Method Details
#payload ⇒ Object
1194 1195 1196 1197 1198 1199 1200 1201 |
# File 'lib/wamp_client/message.rb', line 1194 def payload payload = [self.class.type] payload.push(self.authmethod) payload.push(self.extra) payload end |
#to_s ⇒ Object
1203 1204 1205 |
# File 'lib/wamp_client/message.rb', line 1203 def to_s 'CHALLENGE > ' + self.payload.to_s end |