very simple program:

class Song
  def initialize(duration)
    @duration = duration
  end

  def duration=(new_duration)
    @duration = new_duration
  end
end

song = Song.new(260)
print song.duration


the compiler outputs
D:/Ūʸ/Ruby/attr_writer.rb:12:in `<main>': undefined method `duration'
for
#<Song:0xb33f10 @duration=260> (NoMethodError)

appreciate for your help.