20#include "rubymodule.h"
22#include "rubyconfig.h"
23#include "rubyextension.h"
29class RubyModulePrivate {
30 friend class RubyModule;
39 modname = modname.left(1).upper() + modname.right(modname.length() - 1 );
40 krossdebug(TQString( "Module: %1").arg(modname));
41 VALUE rmodule = rb_define_module(modname.ascii());
42 rb_define_module_function(rmodule, "method_missing", (VALUE (*)(...))RubyModule::method_missing, -1);
44 rb_define_const(rmodule, "MODULEOBJ", rm);
51VALUE RubyModule::method_missing( int argc, VALUE *argv, VALUE self)
53#ifdef KROSS_RUBY_MODULE_DEBUG
54 TQString funcname = rb_id2name(SYM2ID(argv[0]));
55 krossdebug(TQString( "Function %1 missing in a module").arg(funcname));
58 VALUE rubyObjectModule = rb_funcall( self, rb_intern( "const_get"), 1, ID2SYM(rb_intern( "MODULEOBJ")) );
60 Data_Get_Struct(rubyObjectModule, RubyModule, objectModule);
63 return RubyExtension::call_method( object, argc, argv);
TDESharedPtr< Module > Ptr Shared pointer to implement reference-counting.
The common Object class all other object-classes are inheritated from.
TDESharedPtr< Object > Ptr Shared pointer to implement reference-counting.
RubyModule(Kross::Api::Module::Ptr mod, TQString modname) Constructor.
The Ruby plugin for the Kross scripting framework.
The Kross scripting bridge to embed scripting functionality into an application.
void krossdebug(const TQString &s) Debugging function.
|