#Getters & Setters
attr reader :variable1, :variable2, :variable3
attr_writer :variable1, :variable2, :variable3
attr_accessor :variable1, :variable2, :variable3
class Person
attr_reader :name
attr_writer :name
def initialize(name)
@name = name
end
end
vs.
def name
@name
end
def name=(value)
@name = value
end
You're allowed to put an = sign in a method name.
That's just a Ruby convention saying, "hey, this method sets a value!"