It turns out that the problem is not accessing a module's class, but
accessing the contents of a module in a require'd file.
global.rb
require 'app'
app.rb
module RbScriptApp
class Foo
def Bar()
return (rand(100) + 1).to_s()
end
end
end
No matt
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("R
Another option would be
RbScriptApp.const_get("Foo")
I haven't tried that, but I think it should work. Neither solution is indeed
ideal. CLR interop with Modules isn't quite polished yet.
Tomas
-Original Message-
From: ironruby-core-boun...@rubyforge.org
[mailto:ironruby-core-boun...
>You need to include the Module if you want to
>access the class without qualifying it.
I have tried this but it doesn't work (RuntimeBinderException:
'Microsoft.Scripting.Hosting.ScriptScope' does not contain a definition
for 'Foo').
In my original post I had specified the fully qualified name.