Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created December 27, 2011 03:52
Embed
What would you like to do?
This is some random bullshit about non-nullable stuff in Ruby.
# 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