Skip to content

Instantly share code, notes, and snippets.

@richo
Created November 25, 2012 10:51
Show Gist options
  • Save richo/4143076 to your computer and use it in GitHub Desktop.
Save richo/4143076 to your computer and use it in GitHub Desktop.
[4] pry(main)> case "rawr"
[4] pry(main)* when Proc.new { |f| f == "butts" }
[4] pry(main)* "butts"
[4] pry(main)* when Proc.new { |f| f == "rawr" }
[4] pry(main)* "rawr"
[4] pry(main)* end # => "rawr"
[1] pry(main)> t = Proc.new { |f| puts f }
=> #<Proc:0x007f97aa0e3550@(pry):1>
[2] pry(main)> t === "foo"
[1] pry(main)> t = Proc.new { |f| puts f }
=> #<Proc:0x007f97aa0e3550@(pry):1>
[2] pry(main)> t === "foo"
foo
=> nil
[3] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment