Class: Yrpc::Response
- Inherits:
-
Object
- Object
- Yrpc::Response
- Defined in:
- lib/yrpc/controllers/response.rb
Defined Under Namespace
Modules: Code
Instance Method Summary collapse
-
#initialize(operation, execution_time = nil) ⇒ Response
constructor
A new instance of Response.
- #message ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(operation, execution_time = nil) ⇒ Response
Returns a new instance of Response.
84 85 86 87 88 89 90 91 92 |
# File 'lib/yrpc/controllers/response.rb', line 84 def initialize(operation, execution_time = nil) @operation = operation @message = operation.execute @metadata = operation. @trailing_metadata = operation. @deadline = operation.deadline @cancelled = operation.cancelled? @execution_time = execution_time || 0.0 end |
Instance Method Details
#message ⇒ Object
94 95 96 |
# File 'lib/yrpc/controllers/response.rb', line 94 def @message ||= @operation.execute end |
#status ⇒ Object
98 99 100 101 |
# File 'lib/yrpc/controllers/response.rb', line 98 def status @message ||= @operation.execute @message&.status end |