Sha256: af8c0c00448fbd46757b599c32dd5752e07b59647d2725985a22174e795ca024
Contents?: true
Size: 1.17 KB
Versions: 3
Compression:
Stored size: 1.17 KB
Contents
require 'deas/sinatra_runner' module Deas class Route attr_reader :method, :path, :route_proxy, :handler_class def initialize(method, path, route_proxy) @method, @path, @route_proxy = method, path, route_proxy end def validate! @route_proxy.validate! @handler_class = @route_proxy.handler_class end def run(sinatra_call) runner = SinatraRunner.new(self.handler_class, { :sinatra_call => sinatra_call, :request => sinatra_call.request, :response => sinatra_call.response, :session => sinatra_call.session, :params => sinatra_call.params, :logger => sinatra_call.settings.logger, :router => sinatra_call.settings.router, :template_source => sinatra_call.settings.template_source }) sinatra_call.request.env.tap do |env| env['deas.params'] = runner.params env['deas.handler_class_name'] = self.handler_class.name env['deas.logging'].call " Handler: #{env['deas.handler_class_name']}" env['deas.logging'].call " Params: #{env['deas.params'].inspect}" end runner.run end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
deas-0.31.0 | lib/deas/route.rb |
deas-0.30.0 | lib/deas/route.rb |
deas-0.29.0 | lib/deas/route.rb |