Class: Wildcloud::Logger::Middleware::Json
- Inherits:
-
Object
- Object
- Wildcloud::Logger::Middleware::Json
- Defined in:
- lib/wildcloud/logger/middleware/json.rb
Instance Method Summary collapse
- #call(msg) ⇒ Object
-
#initialize(app) ⇒ Json
constructor
A new instance of Json.
Constructor Details
#initialize(app) ⇒ Json
Returns a new instance of Json.
20 21 22 |
# File 'lib/wildcloud/logger/middleware/json.rb', line 20 def initialize(app) @app = app end |
Instance Method Details
#call(msg) ⇒ Object
24 25 26 27 |
# File 'lib/wildcloud/logger/middleware/json.rb', line 24 def call(msg) msg[:json_encoded] = ::JSON.dump(msg) @app.call(msg) end |