They act as markers that create an expanded method:
attr_accessor will create a method to read and write a variable.
attr_writer will create a method to only write a variable.
attr_reader will create a method to only read a variable.
Will get interpreted as:
def sweet=(sweet)
@sweet = sweet
end
def sweet
return @sweet
end
Will get interpreted as:
def sweet=(sweet)
@sweet = sweet
end
Will get interpreted as:
def sweet
return @sweet
end
They are basically time savers rather than having to create accessor methods for every instance variable of a class you would want to access.
Good luck with it AbyssalLord! :thumb: