Just curious what the best practice is for accessing an instance variable from within a class assuming attr_accessor is set.
class Test
attr_accessor :user
def initializer(user)
@user = user
end
def foo
@user
end
end
or
class Test
attr_accessor :user
def initializer(user)
@user = user
end
def foo
self.user
end
end
So by instance variable (@user) or getter method (Test#user)?