server/controller.co - documentation for mapping property
authorAndrew Otto <acotto@gmail.com>
Thu, 19 Apr 2012 18:15:08 +0000 (14:15 -0400)
committerAndrew Otto <acotto@gmail.com>
Thu, 19 Apr 2012 18:15:08 +0000 (14:15 -0400)
lib/server/controller.co

index 9187709..6ae94fa 100644 (file)
@@ -42,6 +42,16 @@ class Controller extends Resource
      *    for this sub-route.
      *  - Object: Hash of HTTP-method (get, put, post, del, or all) to the name
      *    of a method on this Controller.
+     * 
+     * Example:
+     *      { '/foo' => 'foo',
+     *        '/bar' => {'get' => 'get_bar', 'del' => 'delete_bar' },
+     *      }
+     *      If this mapping is in a controller with name 'nonya', then
+     *          GET     '/nonya/foo' -> NonyaController.foo(),
+     *          GET     '/nonya/bar' -> NonyaController.get_bar()
+     *          DELETE  '/nonya/bar' -> NonyaController.delete_bar()
+     * 
      * @type Object
      */
     mapping : null