Skip to content

Instantly share code, notes, and snippets.

@nahurst
Created July 21, 2011 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nahurst/1096242 to your computer and use it in GitHub Desktop.
Save nahurst/1096242 to your computer and use it in GitHub Desktop.
Simple Ruby Injection
(1..10).inject([]) {|all, i| all << "i#{i}"}
# => ["i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8", "i9", "i10"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment