Created
November 20, 2016 01:50
-
-
Save pocke/fc6077fd9710e6c73934ce1af07bb0af 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 Fixnum | |
| def <(right) | |
| super ? right : nil | |
| end | |
| def >(right) | |
| super ? right : nil | |
| end | |
| def >=(right) | |
| super ? right : nil | |
| end | |
| def <=(right) | |
| super ? right : nil | |
| end | |
| end | |
| class Bignum | |
| def <(right) | |
| super ? right : nil | |
| end | |
| def >(right) | |
| super ? right : nil | |
| end | |
| def >=(right) | |
| super ? right : nil | |
| end | |
| def <=(right) | |
| super ? right : nil | |
| end | |
| end | |
| class Float | |
| def <(right) | |
| super ? right : nil | |
| end | |
| def >(right) | |
| super ? right : nil | |
| end | |
| def >=(right) | |
| super ? right : nil | |
| end | |
| def <=(right) | |
| super ? right : nil | |
| end | |
| end | |
| class NilClass | |
| def <(right) | |
| right.is_a?(Numeric) ? nil : super | |
| end | |
| def >(right) | |
| right.is_a?(Numeric) ? nil : super | |
| end | |
| def >=(right) | |
| right.is_a?(Numeric) ? nil : super | |
| end | |
| def <=(right) | |
| right.is_a?(Numeric) ? nil : super | |
| end | |
| end |
Author
pocke
commented
Nov 20, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment