skt wrote:
> Ok, I'm doing the examples from
> http://www.math.umd.edu/~dcarrera/ruby/0.3/chp_04/classes2.html
> 
> Exactly as it's written on the page.
> The first part returns fine, and then I start the second part with the
> "sandy_addr = Address.new" and it gives me this.
> irb(main):181:0> sandy_addr = Address.new
> ArgumentError: wrong number of arguments (0 for 1)
>        from (irb):181:in `initialize'
>        from (irb):181
>        from :0
> irb(main):182:0>
> 
> Anybody?

Ah, OK, i scrolled down and there is the correct definition of Address
you should use:

class Address
    attr_accessor :street, :city, :state, :zip
    def initialize
        @street = @city = @state = @zip = ""
    end
end

so you probably (like me) used a different implementation of Address,
where the constructor takes a parameter.

Replace your implementation of Address with the above one, and
everything should work.

Cheers,
Peter

__
http://www.rubyrailways.com