lib/usher/grapher.rb in joshbuddy-usher-0.4.11 vs lib/usher/grapher.rb in joshbuddy-usher-0.5.1
- old
+ new
@@ -12,11 +12,11 @@
@cache = {}
end
def add_route(route)
route.paths.each do |path|
- unless path.dynamic_keys.size.zero?
+ if path.dynamic?
path.dynamic_keys.each do |k|
@orders[path.dynamic_keys.size][k] << path
@key_count[k] += 1
end
@@ -48,15 +48,15 @@
if cached = @cache[set]
return cached
end
set.size.downto(1) do |o|
set.each do |k|
- @orders[o][k].each { |r|
+ @orders[o][k].each do |r|
if r.can_generate_from?(set)
@cache[set] = r
return r
end
- }
+ end
end
end
nil
end
end