Class: WampClient::Message::Abort

Inherits:
Base
  • Object
show all
Defined in:
lib/wamp_client/message.rb

Overview

Abort Sent by a Peer*to abort the opening of a WAMP session. No response is expected. Formats:

[ABORT, Details|dict, Reason|uri]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Check

included

Constructor Details

#initialize(details, reason) ⇒ Abort

Returns a new instance of Abort.



226
227
228
229
230
231
232
233
234
# File 'lib/wamp_client/message.rb', line 226

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

#detailsObject

Returns the value of attribute details.



224
225
226
# File 'lib/wamp_client/message.rb', line 224

def details
  @details
end

#reasonObject

Returns the value of attribute reason.



224
225
226
# File 'lib/wamp_client/message.rb', line 224

def reason
  @reason
end

Class Method Details

.parse(params) ⇒ Object



240
241
242
243
244
245
246
247
248
# File 'lib/wamp_client/message.rb', line 240

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

.typeObject



236
237
238
# File 'lib/wamp_client/message.rb', line 236

def self.type
  Types::ABORT
end

Instance Method Details

#payloadObject



250
251
252
253
254
255
256
257
# File 'lib/wamp_client/message.rb', line 250

def payload

  payload = [self.class.type]
  payload.push(self.details)
  payload.push(self.reason)

  payload
end

#to_sObject



259
260
261
# File 'lib/wamp_client/message.rb', line 259

def to_s
  'ABORT > ' + self.payload.to_s
end