From: Corey Konrad <0011@...> Date: 2007-03-18T01:13:27+09:00 Subject: Re: attr_accessor question Michael Guterl wrote: > On 3/17/07, Corey Konrad <0011@hush.com> wrote: >> end >> end >> >> animal = Animal.new > > > ArgumentError: wrong number of arguments (0 for 2) > > Your Animal.new is expecting you to pass in color and size. > > animal = Animal.new("brown", "big") > > animal.color = "brown" now why when i add this new attribute attr_accessor :age i get the error message animal.rb:17 warning: parenthesize argument(s) for future versions what does that error message mean? I tried putting parentheses around the 25 but that didnt solve the problem i tried qoutes around the 25 how do i use a number as an argument to an accessor? class Animal attr_accessor :color attr_accessor :size attr_accessor :age end animal = Animal.new animal.color = "brown" puts "The color of the animal is #{animal.color}" animal.color = "red" puts "Now the animal is #{animal.color}" animal.size = "big" puts "The size of the animal is #{animal.size}" animal.size = "small" puts "Now the size of the animal is #{animal.size)" animal.age = 25 puts "The age of the animal is #{animal.age}" -- Posted via http://www.ruby-forum.com/.