Overview - Instance variables (@)
What is it?
Instance variables in Ruby are variables that belong to a specific object. They start with the @ symbol and store data unique to that object. Each object has its own set of instance variables, separate from other objects. They help keep an object's information private and organized.
Why it matters
Without instance variables, objects would have no way to remember their own data. This would make it impossible to model real-world things with unique properties in programs. Instance variables let each object hold its own state, enabling complex and useful behaviors in software.
Where it fits
Before learning instance variables, you should understand basic Ruby variables and objects. After this, you can learn about methods that access instance variables, classes, and object-oriented programming concepts like encapsulation and inheritance.