When accessing an instance variable via accessor method attribute, what is the difference between the expressions self.attribute and attribute? Say, we define an accessor:
def post
@post
end
We can call
self.post
or simply
post
What is special about adding self?
It makes a difference when there might be a local var that shadows method call. Using
selfallows us to specify that we want the method, not the local var. See an example: