Class: FaradayMiddleware::FcoinFormatter
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- FaradayMiddleware::FcoinFormatter
- Defined in:
- lib/fcoin/faraday/fcoin_formatter.rb
Instance Method Summary collapse
-
#call(request_env) ⇒ Object
Format response_env by using Fcoin::Formatter.
Instance Method Details
#call(request_env) ⇒ Object
Format response_env by using Fcoin::Formatter
7 8 9 10 11 12 13 |
# File 'lib/fcoin/faraday/fcoin_formatter.rb', line 7 def call(request_env) @app.call(request_env).on_complete do |response_env| body = JSON.parse(response_env.body) formatter = Fcoin::Formatter.new(body) response_env.body = formatter.formatted_body end end |