Skip to content
This repository
Browse code

slightly more documentation

  • Loading branch information...
commit 90eb28671efca51e462b739dbb6b18ddc4d94ac4 1 parent f96bd2d
Josh Hull authored

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. +9 1 lib/goliath/api.rb
10 lib/goliath/api.rb
@@ -94,7 +94,15 @@ def maps?
94 94 # run Proc.new {|env| [200, {"Content-Type" => "text/html"}, ["Version 0.1"]] }
95 95 # end
96 96 #
97   - # @param name [String] The URL path to map
  97 + # @example
  98 + # map '/user/:id', :id => /\d+/ do
  99 + # # params[:id] will be a number
  100 + # run Proc.new {|env| [200, {"Content-Type" => "text/html"}, ["Loading user #{params[:id]}"]] }
  101 + # end
  102 + #
  103 + # @param name [String] The URL path to map.
  104 + # Optional parts are supported via <tt>(.:format)</tt>, variables as <tt>:var</tt> and globs via <tt>*remaining_path</tt>.
  105 + # Variables can be validated by supplying a Regexp.
98 106 # @param klass [Class] The class to retrieve the middlewares from
99 107 # @param block The code to execute
100 108 def map(name, *args, &block)

0 comments on commit 90eb286

Please sign in to comment.
Something went wrong with that request. Please try again.