aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey/path
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-20 13:17:39 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-20 13:25:14 -0700
commitc99ff6df0031a10d67d6185597085a6bcbeee114 (patch)
treed170875e2b4af83a1f117e5ff3c4533a2b5cfadf /actionpack/lib/action_dispatch/journey/path
parente883db02bce5d5f06628dc9eae51c8f526a4df97 (diff)
downloadrails-c99ff6df0031a10d67d6185597085a6bcbeee114.tar.gz
rails-c99ff6df0031a10d67d6185597085a6bcbeee114.tar.bz2
rails-c99ff6df0031a10d67d6185597085a6bcbeee114.zip
cache the formatter on the path object
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/path')
-rw-r--r--actionpack/lib/action_dispatch/journey/path/pattern.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb
index fb155e516f..28c75618de 100644
--- a/actionpack/lib/action_dispatch/journey/path/pattern.rb
+++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb
@@ -28,6 +28,11 @@ module ActionDispatch
@required_names = nil
@re = nil
@offsets = nil
+ @format = Visitors::FormatBuilder.new.accept(spec)
+ end
+
+ def format_path(path_options)
+ @format.evaluate path_options
end
def ast