Class: HttpRouter::Node::SpanningRegex

### Home Classes Methods

### In Files

- lib/padrino-core/ext/http_router.rb

### Parent

Object

### Methods

- #to_code

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetup
- Padrino::ApplicationSetup::ClassMethods
- Padrino::AuthenticityToken
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Cli::Launcher
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Loader
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::ApplicationWrapper
- Padrino::Mounter::MounterException
- Padrino::ParamsProtection
- Padrino::ParamsProtection::ClassMethods
- Padrino::ParamsProtection::InstanceMethods
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Reloader::Storage
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::FreeRegex
- HttpRouter::Node::Glob
- HttpRouter::Node::Path
- HttpRouter::Node::SpanningRegex
- HttpRouter::Request
- HttpRouter::Route
- Sinatra
- Sinatra::Base
- Sinatra::Request
- Kernel
- Object
- PadrinoTasks

No matching classes.

# HttpRouter::Node::SpanningRegex

### Public Instance Methods

to_code() click to toggle source

    # File lib/padrino-core/ext/http_router.rb, line 120
    def to_code
      params_count = @ordered_indicies.size
      whole_path_var = "whole_path#{root.next_counter}"
      "#{whole_path_var} = request.joined_path
      if match = #{@matcher.inspect}.match(#{whole_path_var}) and match.begin(0).zero?
        _#{whole_path_var} = request.path.dup
        " << param_capturing_code << "
        remaining_path = #{whole_path_var}[match[0].size + (#{whole_path_var}[match[0].size] == ?/ ? 1 : 0), #{whole_path_var}.size]
        request.path = remaining_path.split('/')
        #{node_to_code}
        request.path = _#{whole_path_var}
        request.params.slice!(#{-params_count}, #{params_count})
      end
      "
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.