Mohammad Azam
2009-Jul-06 16:28 UTC
[Ironruby-core] How to Refer to the Classes in my Custom DLL
Hi, I have a class library in C# called "BusinessObjects" and I want to refer to that DLL using IronRuby. I typed: require ''BusinessObjects'' true include BusinessObjects>>> include BusinessObjectsC:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtin s\ModuleOps.cs:793:in `const_missing'': uninitialized constant Object::BusinessOb jects (NameError) from :0 I want to refer to a Customer class inside the BusinessObjects library. -- Posted via http://www.ruby-forum.com/.
Jimmy Schementi
2009-Jul-06 16:32 UTC
[Ironruby-core] How to Refer to the Classes in my Custom DLL
"include" only works for .NET namespaces, as they map to Ruby modules, not Ruby classes. You can''t "include" a Ruby class. Does this class library have a namespace? If so, you can either use the fullname or include the namespace. require ''BusinessObjects'' NameOfNamespace::BusinessObjects # => NameOfNamespace::BusinessObjects # or include NameOfNamespace BusinessObjects # => BusinessObjects> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Mohammad Azam > Sent: Monday, July 06, 2009 9:28 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] How to Refer to the Classes in my Custom DLL > > Hi, > > I have a class library in C# called "BusinessObjects" and I want to refer to that > DLL using IronRuby. > > I typed: > > require ''BusinessObjects'' > true > > include BusinessObjects > > > >>> include BusinessObjects > C:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICT > ED\Builtin > s\ModuleOps.cs:793:in `const_missing'': uninitialized constant > Object::BusinessOb jects (NameError) > from :0 > > I want to refer to a Customer class inside the BusinessObjects library. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Kevin Radcliffe
2009-Jul-06 16:33 UTC
[Ironruby-core] How to Refer to the Classes in my Custom DLL
Mohammad Azam wrote:> Hi, > > I have a class library in C# called "BusinessObjects" and I want to > refer to that DLL using IronRuby. > > I typed: > > require ''BusinessObjects'' > true > > include BusinessObjects > > >>>> include BusinessObjects > C:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtin > s\ModuleOps.cs:793:in `const_missing'': uninitialized constant > Object::BusinessOb > jects (NameError) > from :0 > > I want to refer to a Customer class inside the BusinessObjects library.Is BusinessObjects the top-level namespace here? Usually, you might have some namespace a level above that, like Azam::BusinessObjects Could you attach a zip with the compiled BusinessObjects.dll? Thanks -- Posted via http://www.ruby-forum.com/.