Examveda
Examveda

What does the attr_accessor method do in Ruby?

A. Creates getter and setter methods for an instance variable

B. Creates only getter methods for an instance variable

C. Creates only setter methods for an instance variable

D. Creates private methods for an instance variable

Answer: Option A


This Question Belongs to Ruby Programming >> Classes And Objects In Ruby

Join The Discussion

Related Questions on Classes and Objects in Ruby