Class: Wamp::Client::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.
1092 1093 1094 1095 1096 1097 1098 1099 1100 |
# File 'lib/wamp/client/message.rb', line 1092 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.
1090 1091 1092 |
# File 'lib/wamp/client/message.rb', line 1090 def authmethod @authmethod end |
#extra ⇒ Object
Returns the value of attribute extra.
1090 1091 1092 |
# File 'lib/wamp/client/message.rb', line 1090 def extra @extra end |
Class Method Details
.parse(params) ⇒ Object
1106 1107 1108 1109 1110 1111 1112 1113 1114 |
# File 'lib/wamp/client/message.rb', line 1106 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
1116 1117 1118 1119 1120 1121 1122 1123 |
# File 'lib/wamp/client/message.rb', line 1116 def payload payload = [self.class.type] payload.push(self.authmethod) payload.push(self.extra) payload end |
#to_s ⇒ Object
1125 1126 1127 |
# File 'lib/wamp/client/message.rb', line 1125 def to_s 'CHALLENGE > ' + self.payload.to_s end |