class RestCore::ClashResponse
Public Class Methods
members()
click to toggle source
# File lib/rest-core/middleware/clash_response.rb, line 6 def self.members; [:clash_response]; end
Public Instance Methods
call(env) { |merge(RESPONSE_BODY => clash)| ... }
click to toggle source
# File lib/rest-core/middleware/clash_response.rb, line 9 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