Class: HttpRouter::Node::Glob
- Inherits:
-
HttpRouter::Node
- Object
- HttpRouter::Node
- HttpRouter::Node::Glob
- Defined in:
- lib/http_router/node/glob.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from HttpRouter::Node
#node_position, #parent, #priority, #router
Instance Method Summary collapse
Methods inherited from HttpRouter::Node
#add_arbitrary, #add_destination, #add_free_match, #add_glob, #add_glob_regexp, #add_lookup, #add_match, #add_request, #add_spanning_match, #add_variable, #initialize
Constructor Details
This class inherits a constructor from HttpRouter::Node
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 |
# File 'lib/http_router/node/glob.rb', line 9 def to_code "request.params << (globbed_params#{depth} = []) until request.path.empty? globbed_params#{depth} << request.path.shift #{super} end request.path[0,0] = globbed_params#{depth}" end |
#usable?(other) ⇒ Boolean
5 6 7 |
# File 'lib/http_router/node/glob.rb', line 5 def usable?(other) other.class == self.class end |