Class: Elastictastic::Middleware::JsonEncodeBody
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Elastictastic::Middleware::JsonEncodeBody
- Defined in:
- lib/elastictastic/middleware.rb
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/elastictastic/middleware.rb', line 6 def call(env) case env[:body] when String, nil # nothing else env[:body] = env[:body].to_json end @app.call(env) end |