From: "Jan E." Date: 2012-07-11T06:05:16+09:00 Subject: Re: learning by doing part 2 - tc game Sebastjan H. wrote in post #1068181: > One side note, why this: puts "#{beast} strikes with: " produces this: > # strikes with:? > > I am guessing it has to with the class, but would I get the actual name > of the beast which dealt the damage? How is the object supposed to know that you want the value of @name when you transform it into a string? You have to define a custom "to_s" method. If you don't, the object will use the one provided by the Object class (which returns this identifier string). But in this case it makes more sense to simply get the name: "#{beast.dragon_name} strikes with: " -- Posted via http://www.ruby-forum.com/.