I don't understand why 'attributes=' inside of initialize should have prefix self.
'name' method doesn't need to have prefix self to call 'attributes' method
class A
attr_accessor :attributes
def initialize attrs ={}
self.attributes = attrs
end
def name
puts attributes
end
end
a = {"name" => "someone"}
b = A.new a
b.name
output {"name" => "someone"}
if self.attributes = attrs
change to attributes = attrs
output gonna be nil