Sha256: e4a70b52d11d67d0e9a26743f94e4e8c60d64fa53b9cdb7a84dc2a4ace5c9e9b
Contents?: true
Size: 478 Bytes
Versions: 4
Compression:
Stored size: 478 Bytes
Contents
class Rack::App::Middlewares::Configuration::SerializerSetter def initialize(app, serializer) @app = app @serializer = serializer || raise end def call(env) # env[::Rack::App::Constants::ENV::EXTNAME] ||= extname(env) env[::Rack::App::Constants::ENV::SERIALIZER]= @serializer @app.call(env) end protected def extname(env) path_info = env[::Rack::App::Constants::ENV::PATH_INFO] File.extname(path_info.split("/").last.to_s) end end
Version data entries
4 entries across 4 versions & 1 rubygems