Created
August 25, 2009 21:13
-
-
Save joshbuddy/175037 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router: | |
#initialize(parent_router || nil) | |
#map('path', options = nil) | |
returned object supports attr_accessor :to | |
returned object supports attr_accessor :name | |
#context | |
returns object with attr_reader :host, :port, :scheme, :base_uri | |
#recognize(request_object, path) | |
generator: | |
#generate(env, name or nil, options, defaults) | |
----- | |
context --> generation context only. | |
map('path', options) ... post-conditions? http method pre-conditions. perhaps based blindly to whatever router receives them. | |
generate(nil || symbol, parameters, (array or hash), options, (hash)) | |
recognize(path, request) | |
context -> returns struct of initial context. matches request object? no, this is http specific. http, port scheme base_uri makes sense. | |
is the routing separate from the generation api? should routers agree to support one api, and routers + generators agree to support a superset of that api? | |
standard namespace for variables in rack? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment