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.
194 195 196 197 198 199 200 201 202 |
# File 'lib/wamp/client/message.rb', line 194 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.
192 193 194 |
# File 'lib/wamp/client/message.rb', line 192 def details @details end |
#reason ⇒ Object
Returns the value of attribute reason.
192 193 194 |
# File 'lib/wamp/client/message.rb', line 192 def reason @reason end |
Class Method Details
.parse(params) ⇒ Object
208 209 210 211 212 213 214 215 216 |
# File 'lib/wamp/client/message.rb', line 208 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
218 219 220 221 222 223 224 225 |
# File 'lib/wamp/client/message.rb', line 218 def payload payload = [self.class.type] payload.push(self.details) payload.push(self.reason) payload end |
#to_s ⇒ Object
227 228 229 |
# File 'lib/wamp/client/message.rb', line 227 def to_s 'GOODBYE > ' + self.payload.to_s end |