Created
February 3, 2010 00:17
-
-
Save etiennebarrie/293197 to your computer and use it in GitHub Desktop.
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
| o = Object.new | |
| def o.==(num) | |
| true | |
| end | |
| puts o == 42 | |
| puts [o].include?(42) | |
| puts [o].include?("a") | |
| puts [o].include?(nil) | |
| puts [o].include?(Object.new) | |
| # MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] | |
| # true | |
| # true | |
| # false | |
| # false | |
| # false | |
| # | |
| # ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] | |
| # ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0] | |
| # true | |
| # true | |
| # true | |
| # true | |
| # true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment