-
[Ruby] instance variablescoding for food 2022. 9. 3. 04:02
class User def username=(value) @username = value end def username @username end end p username = "coolgirl" p username
setter, getter methods, instance variable(@username)의 모든 역할을 하는 것 = attr_accessor
class User attr_accessor :username end