Skip to content

Instantly share code, notes, and snippets.

@notactuallypagemcconnell
Created March 15, 2019 16:13
Show Gist options
  • Select an option

  • Save notactuallypagemcconnell/5171e30cb4797b909739c2ab3de08d1c to your computer and use it in GitHub Desktop.

Select an option

Save notactuallypagemcconnell/5171e30cb4797b909739c2ab3de08d1c to your computer and use it in GitHub Desktop.
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