aliozgur posted on January 30, 2009 13:10

The sample Ruby code has no syntax errors. What does the code through lines 3-5 mean? And what is printed to the screen/console?

Any Suggestions ? Smile

 

class Sample
  attr_writer :name
  attr_reader :name do
     "Mr. " + @name
  end
end

s = Sample.new
s.name = "Ali"
puts s.name

 


Posted in: General Development , Ruby  Tags: