Class: Xing::Services::LogJsonRequests
- 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) ⇒ LogJsonRequests
constructor
A new instance of LogJsonRequests.
- #type_string ⇒ Object
Methods inherited from LogJson
Constructor Details
#initialize(app) ⇒ LogJsonRequests
Returns a new instance of LogJsonRequests.
13 14 15 |
# File 'lib/xing/services/log_json_responses.rb', line 13 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/xing/services/log_json_responses.rb', line 17 def call(env) if defined?(Rails) and env["CONTENT_TYPE"] =~ APPJSON_RE log_string(env["rack.input"].read) env["rack.input"].rewind end @app.call(env) end |
#type_string ⇒ Object
25 26 27 |
# File 'lib/xing/services/log_json_responses.rb', line 25 def type_string "Request" end |