Class: WampClient::Message::Published
- Defined in:
- lib/wamp_client/message.rb
Overview
Published Acknowledge sent by a Broker to a Publisher for acknowledged publications. Formats:
[PUBLISHED, PUBLISH.Request|id, Publication|id]
Instance Attribute Summary collapse
-
#publication ⇒ Object
Returns the value of attribute publication.
-
#publish_request ⇒ Object
Returns the value of attribute publish_request.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(publish_request, publication) ⇒ Published
constructor
A new instance of Published.
- #payload ⇒ Object
- #to_s ⇒ Object
Methods included from Check
Constructor Details
#initialize(publish_request, publication) ⇒ Published
Returns a new instance of Published.
447 448 449 450 451 452 453 454 455 |
# File 'lib/wamp_client/message.rb', line 447 def initialize(publish_request, publication) self.class.check_id('publish_request', publish_request) self.class.check_id('publication', publication) self.publish_request = publish_request self.publication = publication end |
Instance Attribute Details
#publication ⇒ Object
Returns the value of attribute publication.
445 446 447 |
# File 'lib/wamp_client/message.rb', line 445 def publication @publication end |
#publish_request ⇒ Object
Returns the value of attribute publish_request.
445 446 447 |
# File 'lib/wamp_client/message.rb', line 445 def publish_request @publish_request end |
Class Method Details
.parse(params) ⇒ Object
461 462 463 464 465 466 467 468 469 |
# File 'lib/wamp_client/message.rb', line 461 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
471 472 473 474 475 476 477 478 |
# File 'lib/wamp_client/message.rb', line 471 def payload payload = [self.class.type] payload.push(self.publish_request) payload.push(self.publication) payload end |
#to_s ⇒ Object
480 481 482 |
# File 'lib/wamp_client/message.rb', line 480 def to_s 'PUBLISHED > ' + self.payload.to_s end |