Skip to content

Instantly share code, notes, and snippets.

@brianc
Created January 13, 2010 17:15
Show Gist options
  • Save brianc/276374 to your computer and use it in GitHub Desktop.
Save brianc/276374 to your computer and use it in GitHub Desktop.
class Person
def say
"hi"
end
def jump
"i jumped"
end
def dance
"like MJ"
end
end
names = [:say, :jump, :dance]
random_method_name = names[rand(names.length-1)]
Person.new.send(random_method_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment