Class: HttpRouter::Node::Glob
Instance Attribute Summary
#router
Instance Method Summary
collapse
#add_arbitrary, #add_destination, #add_free_match, #add_glob, #add_glob_regexp, #add_lookup, #add_match, #add_request, #add_spanning_match, #add_variable, #depth, #initialize, #inspect, #inspect_label, #inspect_matchers_body
Instance Method Details
#node_to_code ⇒ Object
4
|
# File 'lib/http_router/node/glob.rb', line 4
alias_method :node_to_code, :to_code
|
#to_code ⇒ Object
9
10
11
12
13
14
15
16
17
|
# File 'lib/http_router/node/glob.rb', line 9
def to_code
id = root.next_counter
"request.params << (globbed_params#{id} = [])
until request.path.empty?
globbed_params#{id} << request.path.shift
#{super}
end
request.path[0,0] = globbed_params#{id}"
end
|
#usable?(other) ⇒ Boolean
5
6
7
|
# File 'lib/http_router/node/glob.rb', line 5
def usable?(other)
other.class == self.class
end
|