Skip to content

Instantly share code, notes, and snippets.

@louismullie
Created August 3, 2015 23:12
Show Gist options
  • Save louismullie/702115296071e27068ff to your computer and use it in GitHub Desktop.
Save louismullie/702115296071e27068ff to your computer and use it in GitHub Desktop.
class FalseClass
def +(b); 0 + b.to_i; end
def to_i; 0; end
end
class TrueClass
def +(b); 1 + b.to_i; end
def to_i; 1; end
end
class Fixnum
alias :_plus :+
def +(b); _plus(b.to_i); end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment