Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add route description method -- inspect without trying to execute the…

… route.
  • Loading branch information...
commit f954cfab44ab55fdcaf82ce8e31a5c9402839ff3 1 parent 282a222
@pangloss pangloss authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/pacer/core/route.rb
View
8 lib/pacer/core/route.rb
@@ -133,6 +133,10 @@ def pipe
iterator
end
+ def description(join = ' -> ')
+ "#<#{inspect_strings.join(join)}>"
+ end
+
# Returns a string representation of the route definition. If there are
# less than Graph#inspect_limit matches, it will also output all matching
# elements formatted in columns up to a maximum character width of
@@ -142,7 +146,7 @@ def pipe
# @return [String]
def inspect(limit = nil)
if Pacer.hide_route_elements or hide_elements or source_iterator.nil?
- "#<#{inspect_strings.join(' -> ')}>"
+ description
else
Pacer.hide_route_elements do
count = 0
@@ -169,7 +173,7 @@ def inspect(limit = nil)
end
end
puts "Total: #{ count }"
- "#<#{inspect_strings.join(' -> ')}>"
+ description
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.