Class: Ably::Rest::Middleware::Encoder

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/submodules/ably-ruby/lib/ably/rest/middleware/encoder.rb

Overview

Encode the body of the message according to the mime type

Constant Summary collapse

CONTENT_TYPE =
'Content-Type'.freeze

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
# File 'lib/submodules/ably-ruby/lib/ably/rest/middleware/encoder.rb', line 11

def call(env)
  encode env if env.body
  @app.call env
end