Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
Add Comment
Please, Sign In to add comment