Sha256: 2bbfeb20a4a52abe321a03ee5f6d91b276d4581878b2fa8834792b63d660a498
Contents?: true
Size: 483 Bytes
Versions: 20
Compression:
Stored size: 483 Bytes
Contents
require 'rest-core/middleware' require 'rest-core/util/clash' class RestCore::ClashResponse def self.members; [:clash_response]; end include RestCore::Middleware def call env, &k return app.call(env, &k) if env[DRY] return app.call(env, &k) unless clash_response(env) app.call(env){ |res| if res[RESPONSE_BODY].kind_of?(Hash) yield(res.merge(RESPONSE_BODY => Clash.new(res[RESPONSE_BODY]))) else yield(res) end } end end
Version data entries
20 entries across 20 versions & 1 rubygems