Skip to content

Instantly share code, notes, and snippets.

@nkpart
Created November 27, 2008 02:27
Show Gist options
  • Save nkpart/29666 to your computer and use it in GitHub Desktop.
Save nkpart/29666 to your computer and use it in GitHub Desktop.
require 'prohax'
def add a
let( :to => proc { |b| b + a })
end
add(5).to(3)
# => 8
def _if s
let( :then => proc { |blk| blk.call if s })
end
_if(true).then proc { 5 }
# => 5
_if(false).then proc { 5 }
# => nil
# I have no idea why you would do it that way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment