This is some random bullshit about non-nullable stuff in Ruby.
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
| # I'm making all this up. Just random thoughts. It's 11pm, this probably wouldn't even work. | |
| class Object | |
| @nullable = false | |
| def nullable? | |
| @nullable | |
| end | |
| def nullable! | |
| @nullable = true | |
| end | |
| end | |
| some_variable = null # zomg NullAssignmentError | |
| # | |
| # the interpreter would check the property before doing the assignment | |
| some_variable.nullable! | |
| some_variable = null # cool story bro. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment