From: Robert Klemme Date: 2010-09-27T23:02:04+09:00 Subject: Re: error message, undefined method in Set On Mon, Sep 27, 2010 at 3:55 PM, Brian Candler wrote: > Iain Barnett wrote: >> Any help on this is much appreciated, as I've no idea what to try next. > > It is possible that there is another Set class defined somewhere. Would be my guess as well. I would rather try this to get an idea of what class @@available_classes is an instance of: p @@available_classes.class, @@available_classes.class.ancestors It's likely that we see delegator at work here: irb(main):010:0> require 'delegate' => true irb(main):016:0> dd = SimpleDelegator.new ::Set.new => # irb(main):017:0> dd.to_s => "#" irb(main):018:0> dd.class => SimpleDelegator irb(main):019:0> dd.class.ancestors => [SimpleDelegator, Delegator, Object, Kernel, BasicObject] Note item 17 which looks suspiciously similar to what OP posted. Still: irb(main):020:0> dd.include? 123 => false Which would not yield the original error. > Try: > >  puts Set.to_s   # does this show "Set" or "Foo::Set" ? This tells you only about Set but you do not know what class created @@available_classes. >  assert_equal Set, ::Set, "Using Set not at the top level!" Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/