George Moschovitis wrote:
>>I do not think what you want has anything to do with 'duck typing'.
> 
> Of course it has. Have a look at the following example:
> 
> class C1
> attr_accessor :a
> 
> def a1
> puts @a
> end
> 
> def a2
> puts 'hello'
> end
> end
> 
> class C2
> attr_accessor :a
> end
> 
> So for method C1#a1 the class C2 'quacks like a duck' (ie, it has the
> attribute @a)

Your object doesn't quack like a duck. If it did it would have a method 'a1'. Your object has some of the same internal 
organs as a duck, which is both a gruesome image and not the same idea as duck typing. Duck typing is about interface 
not implementation. The implementation should be irrelevant ... only the interface matters.

R.