Created
November 11, 2011 01:53
-
-
Save wuputah/1356916 to your computer and use it in GitHub Desktop.
This file contains 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
module Valim | |
class FacepalmError < StandardError ; end | |
def have_doubts | |
!!yield | |
end | |
extend self | |
end | |
module Kernel | |
def confirm | |
!!self | |
end | |
alias :confirm? :confirm | |
alias :c :confirm | |
alias :c? :confirm | |
def deny | |
!self | |
end | |
alias :deny? :deny | |
alias :d :deny | |
alias :d? :deny | |
def / o | |
self | |
end | |
def confirm_deny? | |
confirm? | |
end | |
def facepalm | |
raise Valim::FacepalmError, "**facepalm**" | |
end | |
end | |
class FalseClass | |
def to_s | |
"deny" | |
end | |
end | |
class TrueClass | |
def to_s | |
"confirm" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment