Class: Wamp::Client::Message::Goodbye
- Defined in:
- lib/wamp/client/message.rb
Overview
Goodbye Sent by a Peer to close a previously opened WAMP session. Must be echo’ed by the receiving Peer. Formats:
[GOODBYE, Details|dict, Reason|uri]
Instance Attribute Summary collapse
-
#details ⇒ Object
Returns the value of attribute details.
-
#reason ⇒ Object
Returns the value of attribute reason.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(details, reason) ⇒ Goodbye
constructor
A new instance of Goodbye.
- #payload ⇒ Object
- #to_s ⇒ Object
Methods included from Check
Constructor Details
#initialize(details, reason) ⇒ Goodbye
Returns a new instance of Goodbye.
245 246 247 248 249 250 251 252 253 |
# File 'lib/wamp/client/message.rb', line 245 def initialize(details, reason) self.class.check_dict('details', details) self.class.check_uri('reason', reason) self.details = details self.reason = reason end |
Instance Attribute Details
#details ⇒ Object
Returns the value of attribute details.
243 244 245 |
# File 'lib/wamp/client/message.rb', line 243 def details @details end |
#reason ⇒ Object
Returns the value of attribute reason.
243 244 245 |
# File 'lib/wamp/client/message.rb', line 243 def reason @reason end |
Class Method Details
.parse(params) ⇒ Object
259 260 261 262 263 264 265 266 267 |
# File 'lib/wamp/client/message.rb', line 259 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
255 256 257 |
# File 'lib/wamp/client/message.rb', line 255 def self.type Types::GOODBYE end |
Instance Method Details
#payload ⇒ Object
269 270 271 272 273 274 275 276 |
# File 'lib/wamp/client/message.rb', line 269 def payload payload = [self.class.type] payload.push(self.details) payload.push(self.reason) payload end |
#to_s ⇒ Object
278 279 280 |
# File 'lib/wamp/client/message.rb', line 278 def to_s 'GOODBYE > ' + self.payload.to_s end |