Any reason why you don’t prefer to work with RubyController class directly from
Ruby code?
…
class RubyController
def info
view_data.add(“Platform”, “IronRuby Mvc 1.0”)
end
end
Tomas
From: [email protected]
[mailto:[email protected]] On Behalf Of Ivan Porto Carrero
Sent: Sunday, February 01, 2009 11:03 AM
To: [email protected]
Subject: [Ironruby-core] Using the generated initializer
Hi
I thought I created a ruby module and ruby class but I must be doing something
wrong.
using RubyMethodAttributes=IronRuby.Runtime.RubyMethodAttributes;
using RubyModuleDefinition = IronRuby.Runtime.RubyModuleAttribute;
using RubyClassDefinition = IronRuby.Runtime.RubyClassAttribute;
using RubyMethodDefinition = IronRuby.Runtime.RubyMethodAttribute;
namespace IronRubyMvcLibrary.Controllers
{
[RubyModuleDefinition("IronRubyMvc")]
public static class IronRubyMvcModule
{
[RubyClassDefinition("Controller", Extends = typeof(RubyController))]
public class RubyControllerOps
{
[RubyMethodDefinition("info", RubyMethodAttributes.PublicInstance)]
public static void Info(RubyController self)
{
self.ViewData().Add("Platform", "IronRuby Mvc 1.0");
}
}
}
}
I then used the classinitgenerator to create an initializer class.
But when I require the assembly after compiling I can't get to IronRubyMvc or
the class.
Do I need to do something else?
_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core