Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

slightly more documentation

  • Loading branch information...
commit 90eb28671efca51e462b739dbb6b18ddc4d94ac4 1 parent f96bd2d
Josh Hull authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/goliath/api.rb
View
10 lib/goliath/api.rb
@@ -94,7 +94,15 @@ def maps?
# run Proc.new {|env| [200, {"Content-Type" => "text/html"}, ["Version 0.1"]] }
# end
#
- # @param name [String] The URL path to map
+ # @example
+ # map '/user/:id', :id => /\d+/ do
+ # # params[:id] will be a number
+ # run Proc.new {|env| [200, {"Content-Type" => "text/html"}, ["Loading user #{params[:id]}"]] }
+ # end
+ #
+ # @param name [String] The URL path to map.
+ # Optional parts are supported via <tt>(.:format)</tt>, variables as <tt>:var</tt> and globs via <tt>*remaining_path</tt>.
+ # Variables can be validated by supplying a Regexp.
# @param klass [Class] The class to retrieve the middlewares from
# @param block The code to execute
def map(name, *args, &block)
Please sign in to comment.
Something went wrong with that request. Please try again.