Skip to content

Instantly share code, notes, and snippets.

@gstark
Created July 26, 2012 18:50
Show Gist options
  • Save gstark/3183777 to your computer and use it in GitHub Desktop.
Save gstark/3183777 to your computer and use it in GitHub Desktop.
lambda_and_threequals.rb
>> matcher = lambda { |value| puts "value is #{value}"; value == "foo" }
=> #<Proc:0x0000000110219b28@(irb):14>
>> matcher === "foo"
=> false
>> matcher.call("foo")
value is foo
=> true
>>
@avdi
Copy link

avdi commented Jul 26, 2012

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