Skip to content

Instantly share code, notes, and snippets.

@zmalltalker
Created October 16, 2008 12:46
Show Gist options
  • Save zmalltalker/17121 to your computer and use it in GitHub Desktop.
Save zmalltalker/17121 to your computer and use it in GitHub Desktop.
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