Skip to content

Instantly share code, notes, and snippets.

@tobias
Created September 14, 2010 17:26
Show Gist options
  • Save tobias/579419 to your computer and use it in GitHub Desktop.
Save tobias/579419 to your computer and use it in GitHub Desktop.
class A
attr_writer :ivar
def foo
self.ivar = 'stuff'
ivar = 'stuff' # this creates a local var called 'ivar' shadows @ivar
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment