Skip to content

Instantly share code, notes, and snippets.

@fabiokr
Created November 16, 2012 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiokr/4089428 to your computer and use it in GitHub Desktop.
Save fabiokr/4089428 to your computer and use it in GitHub Desktop.
class Example
attr_accessor :var_1, :var_2
def with_self(var)
self.var_1 = var
end
def without_self(var)
var_2 = var
end
end
e = Example.new
e.with_self(:hello)
e.without_self(:world)
# Will be :hello
e.var_1
# Will be nil
e.var_2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment