Class: Wamp::Type::Invocation
- Inherits:
-
Object
- Object
- Wamp::Type::Invocation
- Defined in:
- lib/wamp/type/invocation.rb
Overview
Invocation Type
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#connection ⇒ Object
writeonly
Sets the attribute connection.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
-
#request_id ⇒ Object
writeonly
Sets the attribute request_id.
Instance Method Summary collapse
-
#initialize(args: [], kwargs: {}, details: {}) ⇒ Invocation
constructor
A new instance of Invocation.
- #progress(result) ⇒ Object
- #response(result) ⇒ Object
Constructor Details
#initialize(args: [], kwargs: {}, details: {}) ⇒ Invocation
Returns a new instance of Invocation.
10 11 12 13 14 |
# File 'lib/wamp/type/invocation.rb', line 10 def initialize(args: [], kwargs: {}, details: {}) @args = args @kwargs = kwargs @details = details end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/wamp/type/invocation.rb', line 8 def args @args end |
#connection=(value) ⇒ Object (writeonly)
Sets the attribute connection
7 8 9 |
# File 'lib/wamp/type/invocation.rb', line 7 def connection=(value) @connection = value end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
8 9 10 |
# File 'lib/wamp/type/invocation.rb', line 8 def details @details end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
8 9 10 |
# File 'lib/wamp/type/invocation.rb', line 8 def kwargs @kwargs end |
#request_id=(value) ⇒ Object (writeonly)
Sets the attribute request_id
7 8 9 |
# File 'lib/wamp/type/invocation.rb', line 7 def request_id=(value) @request_id = value end |
Instance Method Details
#progress(result) ⇒ Object
16 17 18 |
# File 'lib/wamp/type/invocation.rb', line 16 def progress(result) @connection.transmit @connection.session.(response(result)) end |
#response(result) ⇒ Object
20 21 22 |
# File 'lib/wamp/type/invocation.rb', line 20 def response(result) Wampproto::Message::Yield.new(@request_id, result.details, *result.args, **result.kwargs) end |