Class: HttpRouter::Node

### Home Classes Methods

### In Files

- lib/http_router/node.rb
- lib/http_router/node/abstract_request_node.rb
- lib/http_router/node/free_regex.rb
- lib/http_router/node/glob.rb
- lib/http_router/node/glob_regex.rb
- lib/http_router/node/host.rb
- lib/http_router/node/lookup.rb
- lib/http_router/node/path.rb
- lib/http_router/node/regex.rb
- lib/http_router/node/request_method.rb
- lib/http_router/node/root.rb
- lib/http_router/node/scheme.rb
- lib/http_router/node/spanning_regex.rb
- lib/http_router/node/user_agent.rb
- lib/http_router/node/variable.rb

### Parent

Object

### Namespace

- CLASS HttpRouter::Node::AbstractRequestNode
- CLASS HttpRouter::Node::FreeRegex
- CLASS HttpRouter::Node::Glob
- CLASS HttpRouter::Node::GlobRegex
- CLASS HttpRouter::Node::Host
- CLASS HttpRouter::Node::Lookup
- CLASS HttpRouter::Node::Path
- CLASS HttpRouter::Node::Regex
- CLASS HttpRouter::Node::RequestMethod
- CLASS HttpRouter::Node::Root
- CLASS HttpRouter::Node::Scheme
- CLASS HttpRouter::Node::SpanningRegex
- CLASS HttpRouter::Node::UserAgent
- CLASS HttpRouter::Node::Variable

### Methods

- ::new
- #add_destination
- #add_free_match
- #add_glob
- #add_glob_regexp
- #add_host
- #add_lookup
- #add_match
- #add_request_method
- #add_scheme
- #add_spanning_match
- #add_user_agent
- #add_variable
- #depth
- #inspect
- #inspect_label
- #inspect_matchers_body
- #usable?

### Files

- LICENSE

### Class/Module Index

Quicksearch

- HttpRouter
- HttpRouter::GenerationHelper
- HttpRouter::Generator
- HttpRouter::Generator::PathGenerator
- HttpRouter::Node
- HttpRouter::Node::AbstractRequestNode
- HttpRouter::Node::FreeRegex
- HttpRouter::Node::Glob
- HttpRouter::Node::GlobRegex
- HttpRouter::Node::Host
- HttpRouter::Node::Lookup
- HttpRouter::Node::Path
- HttpRouter::Node::Regex
- HttpRouter::Node::RequestMethod
- HttpRouter::Node::Root
- HttpRouter::Node::Scheme
- HttpRouter::Node::SpanningRegex
- HttpRouter::Node::UserAgent
- HttpRouter::Node::Variable
- HttpRouter::RegexRouteGeneration
- HttpRouter::Request
- HttpRouter::Response
- HttpRouter::Route
- HttpRouter::RouteHelper
- HttpRouter::Util

No matching classes.

# HttpRouter::Node

### Attributes

router[R]

### Public Class Methods

new(router, parent, matchers = []) click to toggle source

    # File lib/http_router/node.rb, line 21
    def initialize(router, parent, matchers = [])
      @router, @parent, @matchers = router, parent, matchers
    end

### Public Instance Methods

add_destination(route, path, param_names = []) click to toggle source

    # File lib/http_router/node.rb, line 65
    def add_destination(route, path, param_names = [])
      add(Path.new(@router, self, route, path, param_names))
    end

add_free_match(regexp) click to toggle source

    # File lib/http_router/node.rb, line 61
    def add_free_match(regexp)
      add(FreeRegex.new(@router, self, regexp))
    end

add_glob() click to toggle source

    # File lib/http_router/node.rb, line 29
    def add_glob
      add(Glob.new(@router, self))
    end

add_glob_regexp(matcher) click to toggle source

    # File lib/http_router/node.rb, line 33
    def add_glob_regexp(matcher)
      add(GlobRegex.new(@router, self, matcher))
    end

add_host(hosts) click to toggle source

    # File lib/http_router/node.rb, line 37
    def add_host(hosts)
      add(Host.new(@router, self, hosts))
    end

add_lookup(part) click to toggle source

    # File lib/http_router/node.rb, line 69
    def add_lookup(part)
      add(Lookup.new(@router, self)).add(part)
    end

add_match(regexp, matching_indicies = [0], splitting_indicies = nil) click to toggle source

    # File lib/http_router/node.rb, line 53
    def add_match(regexp, matching_indicies = [0], splitting_indicies = nil)
      add(Regex.new(@router, self, regexp, matching_indicies, splitting_indicies))
    end

add_request_method(rm) click to toggle source

    # File lib/http_router/node.rb, line 45
    def add_request_method(rm)
      add(RequestMethod.new(@router, self, rm))
    end

add_scheme(scheme) click to toggle source

    # File lib/http_router/node.rb, line 49
    def add_scheme(scheme)
      add(Scheme.new(@router, self, scheme))
    end

add_spanning_match(regexp, matching_indicies = [0], splitting_indicies = nil) click to toggle source

    # File lib/http_router/node.rb, line 57
    def add_spanning_match(regexp, matching_indicies = [0], splitting_indicies = nil)
      add(SpanningRegex.new(@router, self, regexp, matching_indicies, splitting_indicies))
    end

add_user_agent(uas) click to toggle source

    # File lib/http_router/node.rb, line 41
    def add_user_agent(uas)
      add(UserAgent.new(@router, self, uas))
    end

add_variable() click to toggle source

    # File lib/http_router/node.rb, line 25
    def add_variable
      add(Variable.new(@router, self))
    end

depth() click to toggle source

    # File lib/http_router/node.rb, line 94
    def depth
      @parent.send(:depth) + 1
    end

inspect() click to toggle source

    # File lib/http_router/node.rb, line 77
    def inspect
      ins = "#{' ' * depth}#{inspect_label}"
      body = inspect_matchers_body
      unless body =~ /^\s*$/
        ins << "\n" << body
      end
      ins
    end

inspect_label() click to toggle source

    # File lib/http_router/node.rb, line 86
    def inspect_label
      "#{self.class.name.split("::").last} (#{@matchers.size} matchers)"
    end

inspect_matchers_body() click to toggle source

    # File lib/http_router/node.rb, line 90
    def inspect_matchers_body
      @matchers.map{ |m| m.inspect}.join("\n")
    end

usable?(other) click to toggle source

    # File lib/http_router/node.rb, line 73
    def usable?(other)
      false
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.