From: Pit Capitain Date: 2005-10-19T20:21:19+09:00 Subject: Re: Inheriting yaml attributes Alexander Lamb schrieb: > Sorry for the stupid question but why doesn't this work: > > def to_yaml_properties > return (super.to_yaml_properties + %w{ @url }) return (super + %w{ @url }) > end > > I am in a subclass of a class where I have: > > def to_yaml_properties > %w{ @abbr @descr } > end > > Obviously, I want the result to be an array with @abbr, @descr, @url > > But when I print the result: > > ping.to_yaml_properties.each { |prop| puts "-- " + prop.to_s} > > I get only @url > > Something obvious must be wrong here!?! "super" calls the overridden method in the superclass. This is different from Java, for example. Regards, Pit