Class: Wampproto::Message::Publish
- Defined in:
- lib/wampproto/message/publish.rb
Overview
publish message
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(request_id, options, topic, *args, **kwargs) ⇒ Publish
constructor
A new instance of Publish.
- #marshal ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(request_id, options, topic, *args, **kwargs) ⇒ Publish
Returns a new instance of Publish.
9 10 11 12 13 14 15 16 |
# File 'lib/wampproto/message/publish.rb', line 9 def initialize(request_id, , topic, *args, **kwargs) super() @request_id = Validate.int!("Request Id", request_id) @options = Validate.hash!("Options", ) @topic = Validate.string!("Topic", topic) @args = Validate.array!("Arguments", args) @kwargs = Validate.hash!("Keyword Arguments", kwargs) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
7 8 9 |
# File 'lib/wampproto/message/publish.rb', line 7 def args @args end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
7 8 9 |
# File 'lib/wampproto/message/publish.rb', line 7 def kwargs @kwargs end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/wampproto/message/publish.rb', line 7 def @options end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
7 8 9 |
# File 'lib/wampproto/message/publish.rb', line 7 def request_id @request_id end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
7 8 9 |
# File 'lib/wampproto/message/publish.rb', line 7 def topic @topic end |
Class Method Details
.parse(wamp_message) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/wampproto/message/publish.rb', line 25 def self.parse() _type, request_id, , topic, args, kwargs = args ||= [] kwargs ||= {} new(request_id, , topic, *args, **kwargs) end |