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 | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The backports gem might help you out, not sure.