Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created September 25, 2012 01:35
Show Gist options
  • Save havenwood/3779479 to your computer and use it in GitHub Desktop.
Save havenwood/3779479 to your computer and use it in GitHub Desktop.
string is nil in your example
wars = %w{ prussian civil WWII cold_war vietnam }
en = wars.enum_for(:inject, "Names of Wars: ")
en.each do |string, war|
puts string.inspect
puts war
puts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment