Class: Protobuf::Rpc::Middleware::ResponseEncoder
- Inherits:
-
Object
- Object
- Protobuf::Rpc::Middleware::ResponseEncoder
- Includes:
- Logging
- Defined in:
- lib/protobuf/rpc/middleware/response_encoder.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ResponseEncoder
constructor
A new instance of ResponseEncoder.
- #log_signature ⇒ Object
Methods included from Logging
initialize_logger, #log_exception, #logger, #sign_message
Constructor Details
#initialize(app) ⇒ ResponseEncoder
Returns a new instance of ResponseEncoder.
9 10 11 |
# File 'lib/protobuf/rpc/middleware/response_encoder.rb', line 9 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/protobuf/rpc/middleware/response_encoder.rb', line 7 def app @app end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
7 8 9 |
# File 'lib/protobuf/rpc/middleware/response_encoder.rb', line 7 def env @env end |
Instance Method Details
#_call(env) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/protobuf/rpc/middleware/response_encoder.rb', line 17 def _call(env) @env = app.call(env) env.response = response env.encoded_response = encoded_response env end |
#call(env) ⇒ Object
13 14 15 |
# File 'lib/protobuf/rpc/middleware/response_encoder.rb', line 13 def call(env) dup._call(env) end |
#log_signature ⇒ Object
25 26 27 |
# File 'lib/protobuf/rpc/middleware/response_encoder.rb', line 25 def log_signature env.log_signature || super end |