- Local Variables − Local variables are the variables that are defined in a method. Local variables are not available outside the method. Local variables begin with a lowercase letter or _.
- 로컬 변수 - 로컬 변수는 메소드에 정의 된 변수이다. 로컬 변수는 메소드 외부에서 사용할 수 없다. 지역 변수는 소문자 또는 _로 시작한다.
- Instance Variables − Instance variables are available across methods for any particular instance or object. That means that instance variables change from object to object. Instance variables are preceded by the at sign (@) followed by the variable name.
- 인스턴스 변수 - 인스턴스 변수는 특정 인스턴스나 개체에 대해 여러 메서드에서 사용할 수 있다. 이는 인스턴스 변수가 객체에서 객체로 변경된다는 것을 의미한다. 인스턴스 변수 앞에는 at 기호 (@)와 변수 이름이 온다.
- Class Variables − Class variables are available across different objects. A class variable belongs to the class and is a characteristic of a class. They are preceded by the sign @@ and are followed by the variable name.
- 클래스 변수 - 클래스 변수는 여러 객체에서 사용할 수 있다. 클래스 변수는 클래스에 속하며 클래스의 특성입니다. 앞에 @ 기호가 붙고 변수 이름이 온다.
- Global Variables − Class variables are not available across classes. If you want to have a single variable, which is available across classes, you need to define a global variable. The global variables are always preceded by the dollar sign ($).
- 전역 변수 - 클래스 변수는 클래스에서 사용할 수 없다. 클래스간에 사용할 수 있는 단일 변수가 필요하면 전역 변수를 정의해야힌다. 전역 변수는 항상 앞에 달러 기호 ($)가 붙는다.
- "@" 으로 시작하는 변수: 인스턴스 변수
- "@@" 으로 시작하는 변수: 클래스 변수
* 이 게시글의 글들은 Ruby를 공부하면서 메모에 정리하던 내용이므로 참고용으로만 봐주세요.