Created
March 15, 2019 16:13
-
-
Save notactuallypagemcconnell/5171e30cb4797b909739c2ab3de08d1c 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 NilWhatAreYouDoingStahp | |
| attr_accessor :not_nil | |
| def initialize | |
| @not_nil = "I'm not nil! I'm a value!" | |
| end | |
| def wat | |
| if not_nil.nil? | |
| not_nil = "Ok, now I'm not nil." | |
| end | |
| not_nil | |
| end | |
| def omglol | |
| not_nil | |
| end | |
| end | |
| stahp = NilWhatAreYouDoingStahp.new | |
| stahp.wat # => nil | |
| stahp.omglol # => "I'm not nil! I'm a value!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment