Skip to content

Instantly share code, notes, and snippets.

@bricejlin
Last active December 31, 2015 01:49
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 bricejlin/7917021 to your computer and use it in GitHub Desktop.
Save bricejlin/7917021 to your computer and use it in GitHub Desktop.
def crackle
(1..100).map do |i|
crackle = i % 3 == 0 ? 'Crackle' : nil
pop = i % 5 == 0 ? 'Pop' : nil
crackle || pop ? "#{crackle}#{pop}" : i
end
end
puts crackle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment