From: John Cusick Date: 2000-12-27T22:10:02+09:00 Subject: [ruby-talk:8108] Re: Another Nuby question In article , "John Cusick" wrote: > > class Song > attr_reader :name, :artist:, :duration > end > > aSong = Song.new("Bicylops", "Fleck", 260) > > results were: > > irb(main):004:0> aSong = Song.new("Bicylops", "Fleck", 260) > ArgumentError: wrong # of arguments(3 for 0) > (irb):4:in `initialize' > (irb):4:in `new' > (irb):4:in `irb_binding' > irb(main):005:0> > > so what key piece of information did I miss in order to make this work? Thanks for the replies. I had also added: ... def initialize(name, artist, duration) end ... in the proper area when I saw the error, but never added @name = name etc... It's too bad that there will be no warnings throughout the book relative to when it's just a bit or piece of code. I happened to have taken a break around page 20 and wasn't sure how far back I needed to go in order to get the code to work. As long as no one on this list minds answering these questions, though, it may well be a better learning experience. Thanks again, John C.