Parent

Files

HttpRouter::RegexRoute

Public Class Methods

new(router, path, opts = {}) click to toggle source
# File lib/http_router/regex_route.rb, line 3
def initialize(router, path, opts = {})
  @router, @original_path, @opts = router, path, opts
  @param_names = @original_path.respond_to?(:names) ? @original_path.names.map(&:to_sym) : []
  @path_validation_regex = original_path
  Util.add_path_generation(self, self, opts.delete(:path_for_generation), @original_path) if opts.key?(:path_for_generation)
  process_opts
end

Public Instance Methods

add_path_to_tree() click to toggle source
# File lib/http_router/regex_route.rb, line 11
def add_path_to_tree
  @paths = [@original_path]
  add_non_path_to_tree(@router.root.add_free_match(@original_path), path, @param_names)
end
generate_from?(params) click to toggle source
# File lib/http_router/regex_route.rb, line 28
def generate_from?(params)
  false
end
match_partially?() click to toggle source
# File lib/http_router/regex_route.rb, line 20
def match_partially?
  true
end
regex?() click to toggle source
# File lib/http_router/regex_route.rb, line 24
def regex?
  true
end
significant_variable_names() click to toggle source
# File lib/http_router/regex_route.rb, line 16
def significant_variable_names
  @param_names
end
url_with_params(*a) click to toggle source
# File lib/http_router/regex_route.rb, line 32
def url_with_params(*a)
  url_args_processing(a) do |args, options|
    respond_to?(:raw_url) or raise InvalidRouteException
    raw_url(args, options)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.