From: Pat Maddox Date: 2006-05-16T01:06:22+09:00 Subject: Re: Weird class-loading issue (or maybe a problem with define_method?) On 5/15/06, Austin Ziegler wrote: > On 5/15/06, Pat Maddox wrote: > > I'm working on an app and having a strange class loading problem. > > I've extracted it to the most basic code possible. > > Change this: > > # foo.rb > > require "bar" > > class Foo > > FOO = "foo" > > end > > to this: > > # foo.rb > class Foo > FOO = "foo" > end > require "bar" I can't, because some of the methods in the Foo class call Bar methods. > Better yet, get rid of your circular dependency. > > FooBar should be defined in a third file that requires foo.rb and bar.rb. I'm not sure how that fixes anything. Foo has to create some Bar objects, and Bar has to have access to some of the Foo constants. I didn't talk about that in my initial post, but each class interacts with each other. Pat