Created
January 24, 2011 13:26
-
-
Save tundal45/793208 to your computer and use it in GitHub Desktop.
an example of inject with some Johnny Cash flavor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
places = %w( Reno Chicago Fargo Minnesota Buffalo Toronto Winslow Sarasota | |
Wichita Tulsa Ottawa Oklahoma Tampa Panama Mattawa La Paloma | |
Bangor Baltimore Salvador Amarillo Tocapillo Baranquilla and | |
Perdilla) | |
puts places.inject("I've been to: ") { |result, place| "#{result}#{place}, " } + "I'm a killer" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment