Class: Wampproto::Message::Published

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

Overview

published message

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

type, #type

Constructor Details

#initialize(request_id, publication_id) ⇒ Published

Returns a new instance of Published.



9
10
11
12
13
# File 'lib/wampproto/message/published.rb', line 9

def initialize(request_id, publication_id)
  super()
  @request_id     = Validate.int!("Request Id", request_id)
  @publication_id = Validate.int!("Publication Id", publication_id)
end

Instance Attribute Details

#publication_idObject (readonly)

Returns the value of attribute publication_id.



7
8
9
# File 'lib/wampproto/message/published.rb', line 7

def publication_id
  @publication_id
end

#request_idObject (readonly)

Returns the value of attribute request_id.



7
8
9
# File 'lib/wampproto/message/published.rb', line 7

def request_id
  @request_id
end

Class Method Details

.parse(wamp_message) ⇒ Object



19
20
21
22
# File 'lib/wampproto/message/published.rb', line 19

def self.parse(wamp_message)
  _type, request_id, publication_id = Validate.length!(wamp_message, 3)
  new(request_id, publication_id)
end

Instance Method Details

#marshalObject



15
16
17
# File 'lib/wampproto/message/published.rb', line 15

def marshal
  [Type::PUBLISHED, request_id, publication_id]
end