Class: Wampproto::Message::Invocation
- Defined in:
- lib/wampproto/message/invocation.rb
Overview
abort message
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
-
#registration_id ⇒ Object
readonly
Returns the value of attribute registration_id.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(request_id, registration_id, details, *args, **kwargs) ⇒ Invocation
constructor
A new instance of Invocation.
- #marshal ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(request_id, registration_id, details, *args, **kwargs) ⇒ Invocation
Returns a new instance of Invocation.
9 10 11 12 13 14 15 16 |
# File 'lib/wampproto/message/invocation.rb', line 9 def initialize(request_id, registration_id, details, *args, **kwargs) super() @request_id = Validate.int!("Request Id", request_id) @registration_id = Validate.int!("Registration Id", registration_id) @details = Validate.hash!("Details", details) @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/invocation.rb', line 7 def args @args end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
7 8 9 |
# File 'lib/wampproto/message/invocation.rb', line 7 def details @details end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
7 8 9 |
# File 'lib/wampproto/message/invocation.rb', line 7 def kwargs @kwargs end |
#registration_id ⇒ Object (readonly)
Returns the value of attribute registration_id.
7 8 9 |
# File 'lib/wampproto/message/invocation.rb', line 7 def registration_id @registration_id end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
7 8 9 |
# File 'lib/wampproto/message/invocation.rb', line 7 def request_id @request_id end |
Class Method Details
.parse(wamp_message) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/wampproto/message/invocation.rb', line 25 def self.parse() _type, request_id, registration_id, details, args, kwargs = args ||= [] kwargs ||= {} new(request_id, registration_id, details, *args, **kwargs) end |
Instance Method Details
#marshal ⇒ Object
18 19 20 21 22 23 |
# File 'lib/wampproto/message/invocation.rb', line 18 def marshal @payload = [Type::INVOCATION, request_id, registration_id, details] @payload << args if kwargs.any? || args.any? @payload << kwargs if kwargs.any? @payload end |