Pg 63 has the following code:
class Greeter def initialize(name) @name = name Report erratum this copy is (B4.0 printing, May 26, 2010) Prepared exclusively for Robert M Arnold ORGANIZING STRUCTURES 63 end def name @name end def name=(new_name) @name = new_name end end g = Greeter.new("Barney" ) puts g.name #=> Barney g.name = "Betty" puts g.name #=> Betty
Shouldn’t the 2nd to last line of code be:
With no space between name and = as g.name= indicates a method call? Whereas, the way it is written indicates an assignment of value?
If I am wrong Sam, pardon me as I just learning Ruby(read half way through 2 Ruby books before starting this one).