1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

push the formatter up to the Route object

This commit is contained in:
Aaron Patterson 2014-05-21 11:50:17 -07:00
parent e17aead83c
commit 620cb01676
2 changed files with 4 additions and 4 deletions

View file

@ -28,11 +28,10 @@ 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
def build_formatter
Visitors::FormatBuilder.new.accept(spec)
end
def ast

View file

@ -31,6 +31,7 @@ module ActionDispatch
@parts = nil
@decorated_ast = nil
@precedence = 0
@formatter = @path.build_formatter
end
def ast
@ -76,7 +77,7 @@ module ActionDispatch
value.to_s == defaults[key].to_s && !required_parts.include?(key)
end
path.format_path path_options
@formatter.evaluate path_options
end
def optimized_path