Module: RubyPythonBridge
- Defined in:
- ext/rubypython_bridge/rubypython_bridge.c
Defined Under Namespace
Classes: BlankObject, RubyPyClass, RubyPyFunction, RubyPyInstance, RubyPyModule, RubyPyObject
Class Method Summary collapse
-
.import(mname) ⇒ Object
call - seq: import(modname).
-
.start ⇒ Object
call - seq: start().
-
.stop ⇒ Object
call - seq: stop().
Class Method Details
.import(mname) ⇒ Object
call - seq: import(modname)
Imports the python module modname using the interpreter and returns a ruby wrapper
63 64 65 66 |
# File 'ext/rubypython_bridge/rubypython_bridge.c', line 63
static VALUE rp_import(VALUE self, VALUE mname)
{
return rb_class_new_instance(1,&mname, cRubyPyModule);
}
|
.start ⇒ Object
call - seq: start()
Starts the python interpreter
74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'ext/rubypython_bridge/rubypython_bridge.c', line 74
VALUE rp_start(VALUE self)
{
if(Py_IsInitialized())
{
return Qfalse;
}
Py_Initialize();
return Qtrue;
}
|
.stop ⇒ Object
call - seq: stop()
Stop the python interpreter
92 93 94 95 96 97 98 99 100 101 102 |
# File 'ext/rubypython_bridge/rubypython_bridge.c', line 92
VALUE rp_stop(VALUE self)
{
if(Py_IsInitialized())
{
Py_Finalize();
return Qtrue;
}
return Qfalse;
}
|