Method: Usher::Route#find_matching_path

Defined in:
lib/usher/route.rb

#find_matching_path(params) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/usher/route.rb', line 37

def find_matching_path(params)
  if params.nil? || params.empty?
    matching_path = @paths.first
  else
    matching_path = @paths.size == 1 ? @paths.first : grapher.find_matching_path(params)
  end

  if parent_route
    matching_path = parent_route.find_matching_path(params).merge(matching_path)
    matching_path.route = self
  end

  matching_path
end