From c8cba7db76d7128dfd8fd03de0e085c81bbed92a Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Wed, 20 Jan 2010 10:56:06 -0600 Subject: Add AD::Route#to_s Signed-off-by: Joshua Peek --- actionpack/lib/action_dispatch/routing/route.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/lib/action_dispatch/routing') diff --git a/actionpack/lib/action_dispatch/routing/route.rb b/actionpack/lib/action_dispatch/routing/route.rb index f1431e7a37..e6e44d3546 100644 --- a/actionpack/lib/action_dispatch/routing/route.rb +++ b/actionpack/lib/action_dispatch/routing/route.rb @@ -44,6 +44,12 @@ module ActionDispatch def to_a [@app, @conditions, @defaults, @name] end + + def to_s + @to_s ||= begin + "%-6s %-40s %s" % [(verb || :any).to_s.upcase, path, requirements.inspect] + end + end end end end -- cgit v1.2.3