Class: Wampproto::Message::Subscribe

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

Overview

abort message

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

type, #type

Constructor Details

#initialize(request_id, options, topic) ⇒ Subscribe

Returns a new instance of Subscribe.



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

def initialize(request_id, options, topic)
  super()
  @request_id = Validate.int!("Request Id", request_id)
  @options = Validate.hash!("Options", options)
  @topic = Validate.string!("Topic", topic)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#request_idObject (readonly)

Returns the value of attribute request_id.



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

def request_id
  @request_id
end

#topicObject (readonly)

Returns the value of attribute topic.



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

def topic
  @topic
end

Class Method Details

.parse(wamp_message) ⇒ Object



20
21
22
23
# File 'lib/wampproto/message/subscribe.rb', line 20

def self.parse(wamp_message)
  _type, request_id, options, topic = wamp_message
  new(request_id, options, topic)
end

Instance Method Details

#marshalObject



16
17
18
# File 'lib/wampproto/message/subscribe.rb', line 16

def marshal
  [Type::SUBSCRIBE, request_id, options, topic]
end