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 18
def initialize(router, parent, matchers = [])
  @router, @parent, @matchers = router, parent, matchers
end

Public Instance Methods

add_arbitrary(blk, allow_partial, param_names) click to toggle source
# File lib/http_router/node.rb, line 39
def add_arbitrary(blk, allow_partial, param_names)
  add(Arbitrary.new(@router, self, allow_partial, blk, param_names))
end
add_destination(route, path, param_names = []) click to toggle source
# File lib/http_router/node.rb, line 55
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 51
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 26
def add_glob
  add(Glob.new(@router, self))
end
add_glob_regexp(matcher) click to toggle source
# File lib/http_router/node.rb, line 30
def add_glob_regexp(matcher)
  add(GlobRegex.new(@router, self, matcher))
end
add_lookup(part) click to toggle source
# File lib/http_router/node.rb, line 59
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 43
def add_match(regexp, matching_indicies = [0], splitting_indicies = nil)
  add(Regex.new(@router, self, regexp, matching_indicies, splitting_indicies))
end
add_request(opts) click to toggle source
# File lib/http_router/node.rb, line 34
def add_request(opts)
  raise unless opts
  add(Request.new(@router, self, opts))
end
add_spanning_match(regexp, matching_indicies = [0], splitting_indicies = nil) click to toggle source
# File lib/http_router/node.rb, line 47
def add_spanning_match(regexp, matching_indicies = [0], splitting_indicies = nil)
  add(SpanningRegex.new(@router, self, regexp, matching_indicies, splitting_indicies))
end
add_variable() click to toggle source
# File lib/http_router/node.rb, line 22
def add_variable
  add(Variable.new(@router, self))
end
depth() click to toggle source
# File lib/http_router/node.rb, line 84
def depth
  @parent.send(:depth) + 1
end
inspect() click to toggle source
# File lib/http_router/node.rb, line 67
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 76
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 80
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 63
def usable?(other)
  false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.