On Jan 15, 2011, at 2:55 AM, Joshua M. wrote:

> No matter what I do I can only access RbScriptApp and not Foo if I call
> Runtime.UseFile("global.rb"). So far I have two other work arounds: 1.)
> create wrapper methods for everything I want to access in app.rb (ugh),
> or 2.) use Engine.Execute("RbScriptApp::Foo.new"). The latter is more
> preferrable, I suppose, but it seems strange that I can't access Foo by
> dynamic.

That's how Modules work in Ruby. Just like namespaces in C#.

Try adding 

include RbScriptApp

to your global.rb file. You need to include the Module if you want to access 
the class without qualifying it.


> Any more information about this issue would be very helpful and
> appreciated.
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core

--
Will Green
w...@hotgazpacho.org



_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to