Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Latest commit

 

History

History
3 lines (2 loc) · 558 Bytes

variable_instance.md

File metadata and controls

3 lines (2 loc) · 558 Bytes

Instance variable

An instance variable is a pointer to an object and is available only inside a single object (an "instance"). They start with a single @ character. These variables are used to carry object state, which differentiates one instance from another. An instance variable can be accessed before it is even assigned; its default value will be nil. However, in verbose mode the ruby interpreter will issue a warning about accessing a variable that is not declared. Instance variables are often initialized in the "initialize" method in a class.