Class: Async::Bus::Protocol::Response
- Inherits:
-
Object
- Object
- Async::Bus::Protocol::Response
- Defined in:
- lib/async/bus/protocol/response.rb
Overview
Represents a response message from a remote procedure call.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
- #The transaction ID.(transactionID.) ⇒ Object readonly
Class Method Summary collapse
-
.unpack(unpacker) ⇒ Object
Unpack a response from a MessagePack unpacker.
Instance Method Summary collapse
-
#initialize(id, result) ⇒ Response
constructor
Initialize a new response message.
-
#pack(packer) ⇒ Object
Pack the response into a MessagePack packer.
- #The result value.=(resultvalue. = (value)) ⇒ Object
Constructor Details
#initialize(id, result) ⇒ Response
Initialize a new response message.
14 15 16 17 |
# File 'lib/async/bus/protocol/response.rb', line 14 def initialize(id, result) @id = id @result = result end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
20 21 22 |
# File 'lib/async/bus/protocol/response.rb', line 20 def id @id end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
23 24 25 |
# File 'lib/async/bus/protocol/response.rb', line 23 def result @result end |
#The transaction ID.(transactionID.) ⇒ Object (readonly)
20 |
# File 'lib/async/bus/protocol/response.rb', line 20 attr :id |
Class Method Details
.unpack(unpacker) ⇒ Object
Unpack a response from a MessagePack unpacker.
35 36 37 38 39 40 |
# File 'lib/async/bus/protocol/response.rb', line 35 def self.unpack(unpacker) id = unpacker.read result = unpacker.read return self.new(id, result) end |
Instance Method Details
#pack(packer) ⇒ Object
Pack the response into a MessagePack packer.
27 28 29 30 |
# File 'lib/async/bus/protocol/response.rb', line 27 def pack(packer) packer.write(@id) packer.write(@result) end |
#The result value.=(resultvalue. = (value)) ⇒ Object
23 |
# File 'lib/async/bus/protocol/response.rb', line 23 attr :result |