Method: ActionView::Resolver::PathParser#parse

Defined in:
actionview/lib/action_view/template/resolver.rb

#parse(path) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'actionview/lib/action_view/template/resolver.rb', line 36

def parse(path)
  @regex ||= build_path_regex
  match = @regex.match(path)
  path = TemplatePath.build(match[:action], match[:prefix] || "", !!match[:partial])
  details = TemplateDetails.new(
    match[:locale]&.to_sym,
    match[:handler]&.to_sym,
    match[:format]&.to_sym,
    match[:variant]&.to_sym
  )
  ParsedPath.new(path, details)
end