Created
October 16, 2008 12:46
-
-
Save zmalltalker/17121 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class FalseClass | |
def ifTrue(blk, options) | |
options[:ifFalse].call | |
end | |
end | |
class TrueClass | |
def ifTrue(blk, options) | |
blk.call | |
end | |
end | |
true.ifTrue(lambda {puts "True is true"}, :ifFalse => lambda {puts "True is false, generally not a good thing"}) | |
false.ifTrue(lambda {puts "False is true, generally not a good thing"}, :ifFalse => lambda {puts "False is false, it should be"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment