Created
September 6, 2013 07:16
-
-
Save bjhaid/6460526 to your computer and use it in GitHub Desktop.
method_missing blowing up
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
2.0.0p247 :001 > def method_missing m,*args; [m.to_s,args].flatten.join " "; end | |
=> nil | |
2.0.0p247 :002 > "j".happy "hh" | |
2.0.0p247 :001 > def method_missing *args; args.join " "; end | |
=> nil | |
2.0.0p247 :002 > "j".happy | |
SystemStackError: stack level too deep | |
from /Users/bjhaid/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/workspace.rb:86 | |
Maybe IRB bug! | |
2.0.0p247 :003 > def method_missing m,*args; args.join " "; end | |
Segmentation fault: 11 | |
2.0.0p247 :001 > def method_missing m,*args; [m,args].flatten " "; end | |
=> nil | |
2.0.0p247 :002 > "j".happy hah | |
Segmentation fault: 11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment