Skip to content

Instantly share code, notes, and snippets.

@arnemart
Last active August 29, 2015 14:13
Show Gist options
  • Save arnemart/1e27a8e1963cc9eeaf2d to your computer and use it in GitHub Desktop.
Save arnemart/1e27a8e1963cc9eeaf2d to your computer and use it in GitHub Desktop.
It's totally thread safe, don't worry about it
class TrueClass
def self.setVal(val)
$val = val
end
def <(n)
$val < n
end
end
class FalseClass
def <(n)
false
end
end
class Fixnum
alias_method :oldlt, :<
def <(n)
TrueClass.setVal(n)
self.oldlt(n)
end
end
puts 4 < 6 < 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment