lib/fakeit/middleware/recorder.rb in fakeit-0.7.1 vs lib/fakeit/middleware/recorder.rb in fakeit-0.8.0

- old
+ new

@@ -1,11 +1,9 @@ module Fakeit module Middleware class Recorder - def initialize(app) - @app = app - end + def initialize(app) = @app = app def call(env) env .tap(&method(:log_request)) .then { @app.call(_1) } @@ -18,11 +16,9 @@ env['rack.input'] &.tap { |body| Logger.info("Request body: #{body.read}") } &.tap { |body| body.rewind } end - def log_response(response) - Logger.info("Response body: #{response[2].first}") - end + def log_response(response) = Logger.info("Response body: #{response[2].first}") end end end