Skip to content

Instantly share code, notes, and snippets.

@farleyknight
Created July 16, 2014 20:31
Show Gist options
  • Save farleyknight/4a7fd7ef1330ac9ca431 to your computer and use it in GitHub Desktop.
Save farleyknight/4a7fd7ef1330ac9ca431 to your computer and use it in GitHub Desktop.
undefined method '+' for Nil
class A
# Delete this method and it compiles!
def initialize
end
def initialize(@x)
end
def inspect
if @x
(@x + 3).to_s
end
end
end
A.new(2).inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment