Class: HttpRouter

### Home Classes Methods

### In Files

- lib/padrino-core/application/routing.rb

### Parent

Object

### Namespace

- MODULE HttpRouter::Node
- CLASS HttpRouter::Request
- CLASS HttpRouter::Route

### Methods

- #process_destination_path
- #rewrite_partial_path_info
- #rewrite_path_info
- #sort!

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetupError
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Erubis
- Padrino::Erubis::SafeBufferEnhancer
- Padrino::Erubis::SafeBufferTemplate
- Padrino::Erubis::Template
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::MounterException
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Rendering
- Padrino::Rendering::ClassMethods
- Padrino::Rendering::InstanceMethods
- Padrino::Rendering::SafeTemplate
- Padrino::Rendering::TemplateNotFound
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- Padrino::Utils
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::Path
- HttpRouter::Request
- HttpRouter::Route
- Haml
- Haml::Helpers
- Haml::Util
- Sinatra
- Sinatra::Request
- Slim
- Slim::Template
- Tilt
- Tilt::HamlTemplate
- FileSet
- Kernel
- Module
- Object
- ObjectSpace
- PadrinoTasks
- String
- SupportLite

No matching classes.

# HttpRouter

HttpRouter adapter

@private

### Attributes

current_order[RW]

### Public Instance Methods

process_destination_path(path, env) click to toggle source

    # File lib/padrino-core/application/routing.rb, line 27
    def process_destination_path(path, env)
      Thread.current['padrino.instance'].instance_eval do
        request.route_obj = path.route
        @_response_buffer = nil
        @route    = path.route
        @params ||= {}
        @params.update(env['router.params'])
        @block_params = if match_data = env['router.request'].extra_env['router.regex_match']
          params_list = match_data.to_a
          params_list.shift
          @params[:captures] = params_list
          params_list
        else
          env['router.request'].params
        end
        # Provide access to the current controller to the request
        # Now we can eval route, but because we have "throw halt" we need to be
        # (en)sure to reset old layout and run controller after filters.
        original_params = @params
        parent_layout   = @layout
        successful      = false
        begin
          filter! :before
          (@route.before_filters - settings.filters[:before]).each { |block| instance_eval(&block) }
          @layout = path.route.use_layout if path.route.use_layout
          @route.custom_conditions.each { |block| pass if block.bind(self).call == false } if @route.custom_conditions
          halt_response     = catch(:halt) { route_eval { @route.dest[self, @block_params] } }
          @_response_buffer = halt_response.is_a?(Array) ? halt_response.last : halt_response
          successful        = true
          halt halt_response
        ensure
          (@route.after_filters - settings.filters[:after]).each { |block| instance_eval(&block) } if successful
          @layout = parent_layout
          @params = original_params
        end
      end
    end

rewrite_partial_path_info(env, request) click to toggle source

    # File lib/padrino-core/application/routing.rb, line 24
    def rewrite_partial_path_info(env, request); end

rewrite_path_info(env, request) click to toggle source

    # File lib/padrino-core/application/routing.rb, line 25
    def rewrite_path_info(env, request); end

sort!() click to toggle source

    # File lib/padrino-core/application/routing.rb, line 123
    def sort!
      @routes.sort!{ |a, b| a.order <=> b.order }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.