how come this doesnt worh though?
class Animal
attr_accessor :color
attr_accessor :size
def initialize(color, size)
@color = color
@size = size
end
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}"
thanks
--
Posted via http://www.ruby-forum.com/.