Class: Xing::Services::LogJsonResponses
- Defined in:
- lib/xing/services/log_json_responses.rb
Constant Summary
Constants inherited from LogJson
Xing::Services::LogJson::APPJSON_RE
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ LogJsonResponses
constructor
A new instance of LogJsonResponses.
- #type_string ⇒ Object
Methods inherited from LogJson
Constructor Details
#initialize(app) ⇒ LogJsonResponses
Returns a new instance of LogJsonResponses.
31 32 33 |
# File 'lib/xing/services/log_json_responses.rb', line 31 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/xing/services/log_json_responses.rb', line 35 def call(env) @app.call(env).tap do |status, headers, response| if defined?(Rails) and headers["Content-Type"] =~ APPJSON_RE log_string(response.body) end end end |
#type_string ⇒ Object
43 44 45 |
# File 'lib/xing/services/log_json_responses.rb', line 43 def type_string "Response" end |