lib/hanami/router/trie.rb in hanami-router-2.0.0.alpha6 vs lib/hanami/router/trie.rb in hanami-router-2.0.0.beta1
- old
+ new
@@ -52,11 +52,16 @@
private
# @api private
# @since 2.0.0
+ SEGMENT_SEPARATOR = /\//
+ private_constant :SEGMENT_SEPARATOR
+
+ # @api private
+ # @since 2.0.0
def for_each_segment(path, &blk)
- _, *segments = path.split(/\//)
+ _, *segments = path.split(SEGMENT_SEPARATOR)
segments.each(&blk)
end
end
end
end