From: "Jan E." Date: 2012-08-25T06:20:52+09:00 Subject: Re: learning by doing part 2 - tc game Hi, The "defined?" operator is simply wrong in this case. It checks *the current scope* for variables, methods etc. For example: x = 0 C = 15 puts defined? x # this outputs "local-variable" puts defined? C # this outputs "constant" puts defined? a # this outputs nothing (because the result is nil) You want something completely different, namely check if an object has a specific method. That's what Object#respond_to? is for: def effect_output(card) if card.respond_to? :attack puts "#{card.name.capitalize} hits with #{card.attack}." elsif card.respond_to? :heal puts "#{card.name.capitalize} heals for #{card.heal}." end end This will call "attack" and "heal" only if the card object does actually have those methods. What should have made you suspicious is that you never had to specify any object. How is Ruby then supposed to know that you want to look into the card object? -- Posted via http://www.ruby-forum.com/.