attribute writer code example
Example 1: attribute writer
person = Person.new("Ada")
person.password=("super secret")
p person
Example 2: attribute writer
class Person
def initialize(name)
@name = name
end
def name
@name
end
def password=(password)
@password = password
end
end