Be cautious when calling setter-methods from within their own class, Ruby might think you want to create a local variable, so you have to call it explicitely with self as the receiver
从类中调用setter方法时要小心,Ruby可能会认为你想创建一个局部变量,所以你必须以self作为接收者来显式地调用它
Be cautious when calling setter-methods from within their own class, Ruby might think you want to create a local variable, so you have to call it explicitely with self as the receiver
从类中调用setter方法时要小心,Ruby可能会认为你想创建一个局部变量,所以你必须以self作为接收者来显式地调用它
应用推荐