Skip to content

Instantly share code, notes, and snippets.

@rolandobrown
Last active August 29, 2015 14:27
Show Gist options
  • Save rolandobrown/928ae13194e97b626f54 to your computer and use it in GitHub Desktop.
Save rolandobrown/928ae13194e97b626f54 to your computer and use it in GitHub Desktop.
A method that numbers an array of Hip-Hop Elements as expressed by Kool D.J. Herc and Afrikka Bambatta. Note, this does not include the 9 Refinitions established by KRS-One. Also, big love to Pebblee Poo.
# This method numbers the array of Hip-Hop Elements as expressed by Kool D.J. Herc and Afrikka Bambatta.
# Note, this does not include the 9 Refinitions established by KRS-One. Also, big love to Pebblee Poo.
elements = ["Breaking", "Mc'ing", "Graffiti Art", "DJ'ing", "Knowledge"]
def hip_hop_culture(elements)
elements.map.with_index(1) { |elements, idx| puts "#{idx}. #{elements}"}
# with_index(offset = 0) {|(*args), idx| ... }
end
puts hip_hop_culture(elements)
# >> 1. Breaking
# >> 2. Mc'ing
# >> 3. Graffiti Art
# >> 4. DJ'ing
# >> 5. Knowledge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment