Parent

Files

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.