Sha256: 3238e0f2cae389e70a111d941b9d85ec1d4e00ff7b27e04d5755373110df56f0
Contents?: true
Size: 315 Bytes
Versions: 6
Compression:
Stored size: 315 Bytes
Contents
class DefinedMiddleware def initialize(app) @app = app end def call(env) path = env['PATH_INFO'] if m = path.match(/^\/const\/(.*)/) const = m[1] answer = eval("defined?(#{const})") answer ||= "nil" return [200, {}, [answer]] else @app.call(env) end end end
Version data entries
6 entries across 6 versions & 1 rubygems