Skip to content

Instantly share code, notes, and snippets.

@13k
Created April 7, 2013 03:29
Show Gist options
  • Save 13k/5328807 to your computer and use it in GitHub Desktop.
Save 13k/5328807 to your computer and use it in GitHub Desktop.
class C
attr_accessor :counter
def initialize
@counter = 1
end
def increment
counter = counter + 1
end
end
p C.new.increment
# undefined method `+' for nil:NilClass (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment