From: Dave Thomas Date: 2000-03-31T12:32:13-06:00 Subject: [ruby-talk:02309] Question about attribute writers Given: class Fred def age @age end def age=(val) @age = val end def ageInMonths age * 12 end def ageInMonths=(val) age = val / 12 end def initialize(age) @age = age end end f = Fred.new(10) p f.age p f.ageInMonths f.ageInMonths = 300 p f.age I get 10 120 10 The reason is that the assignment age = val/12 in Fred#ageInMonths= is creating a local variable 'age', rather than invoking the age= method. This seems inconsistent with the fact that age / 12 in Fred#ageInMonths is correctly using the attribute reading function. Is this the expected behavior? Dave