Created
February 5, 2015 13:50
-
-
Save dylanerichards/1d53d177d957f0788741 to your computer and use it in GitHub Desktop.
Assigning Ruby Core Methods to People
This file contains hidden or 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
| people = %w(Umar Trevor Randy Marlone Gerardo Alex Isaac Conner) | |
| methods = [ | |
| "String#count", "String#index", "String#rindex", | |
| "String#gsub", "String#to_sym", "Hash#delete", | |
| "Hash#delete_if", "Hash#each_key", "Hash#each_value", | |
| "Hash#value?", "Hash#invert", "Hash#length", | |
| "Hash#merge", "Hash#select", "Hash#to_a", | |
| "Hash#values", "Hash#keys", "Array#compact", | |
| "Array#delete", "Array#delete_at", "Array#delete_if", | |
| "Array#insert", "Array#join", "Array#pop", | |
| "Array#push", "Array#shift", "Array#uniq", | |
| "Array#unshift", "Enumerable#include?", "Enumerable#sort", | |
| "Enumerable#map", "Enumerable#collect", | |
| ] | |
| shuffled_methods = methods.shuffle | |
| split_shuffled_methods = shuffled_methods.each_slice(4).to_a | |
| people.each do |person| | |
| puts "#{person}: #{split_shuffled_methods.pop}" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment