self - is what's called a reflective method - refers to the instance on which it is called.
- self.variable refers to the most current attribute of that object
- useful when you are overwriting or changing variables often.
- Calling @variable instead of self.variable will return the original instance variable defined in the class.
- self.method is a Class Method - in this case, 'self' refers to the Class itself
- identical to writing Class_Name.method (which you shouldn't do inside a Class)
Two uses for 'self':