Sha256: 7fd4352f6cda50e0f63294fbdb5b1ea7a3f8667bbd9e44e5206b10c88a7fa741
Contents?: true
Size: 533 Bytes
Versions: 4
Compression:
Stored size: 533 Bytes
Contents
module Newark class Response < Rack::Response JSON_MIME_TYPE = 'application/json'.freeze def body=(value) value = if value.respond_to?(:to_str) [ value.to_str ] elsif value.respond_to?(:to_hash) && defined?(MultiJson) header['Content-Type'] = JSON_MIME_TYPE [ MultiJson.dump(value) ] elsif value.respond_to?(:to_ary) value else [ value ] end super value end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
newark-0.0.8 | lib/newark/response.rb |
newark-0.0.7 | lib/newark/response.rb |
newark-0.0.6 | lib/newark/response.rb |
newark-0.0.5 | lib/newark/response.rb |