Created
June 13, 2013 20:39
-
-
Save barroso/5777142 to your computer and use it in GitHub Desktop.
run all methods with no params on any ruby object
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
def escangalha_tudo obj, com_putaria=false | |
methods = obj.methods | |
#methods = obj.methods - Object.methods | |
methods.sort! | |
methods.each do |method| | |
begin | |
puts "Method = #{method} => #{obj.send method}" unless !com_putaria and [:debugger, :breakpoint].include? method | |
rescue Exception => e | |
end | |
end | |
end | |
escangalha_tudo "babau", true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment