RubyOOP lesson 14: Using attr_reader and attr_writer and attr_accessor methods .

preview_player
Показать описание
In this lesson you learn how to use the attr_reader , attr_writer and attr_accessor method in Ruby.
Рекомендации по теме
Комментарии
Автор

what does attr_reader, and attr_writer do?

echolima
Автор

Hey so I have a question and I'll be as detailed as possible.
when you create an instance variable inside "def initialize", say @name, does the *attr_accessor* just know that it should refer to the instance variable created in *def initialize*?

ladedadedaschlobonmeknob