Created
July 26, 2012 18:50
-
-
Save gstark/3183777 to your computer and use it in GitHub Desktop.
lambda_and_threequals.rb
This file contains 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
>> matcher = lambda { |value| puts "value is #{value}"; value == "foo" } | |
=> #<Proc:0x0000000110219b28@(irb):14> | |
>> matcher === "foo" | |
=> false | |
>> matcher.call("foo") | |
value is foo | |
=> true | |
>> |
Ah, silly me, still on 1.8.7 -- Waiting for JRuby to make 1.9 mode default (in the awesomely anticipated 1.7) and that Mountain Lion broke my ability to build 1.8.7
Thanks!
The backports gem might help you out, not sure.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I run it locally, under 1.9.3: