Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replace each with inject.

  • Loading branch information...
commit 9c71e673f04904d53ae5726e413b354870d801ee 1 parent 7071cc6
@georgebrock georgebrock authored
Showing with 3 additions and 7 deletions.
  1. +3 −7 lib/helpers/uri_extractor.rb
View
10 lib/helpers/uri_extractor.rb
@@ -26,17 +26,13 @@ def extract_uris(source)
end
def extract_uris_from_hash(hash)
- uris = []
-
- hash.each do |key, value|
+ hash.inject([]) do |uris, (key, value)|
if key == 'uri'
- uris << value
+ uris + [value]
else
- uris += extract_uris(value)
+ uris + extract_uris(value)
end
end
-
- uris
end
def extract_uris_from_array(array)
Please sign in to comment.
Something went wrong with that request. Please try again.