Sha256: ec89c0bde4efd23b378c8eec4e29b88b769f3f44d7a26dcee24a448d462d1d96

Contents?: true

Size: 626 Bytes

Versions: 1

Compression:

Stored size: 626 Bytes

Contents

#include "rp_function.h"
#include "rp_object.h"

RUBY_EXTERN VALUE mRubyPythonBridge;
RUBY_EXTERN VALUE cRubyPyObject;

VALUE cRubyPyFunction;

VALUE rpFunctionFromPyObject(PyObject *pFunc)
{
	PObj* self;
	VALUE rFunc = rb_class_new_instance(0, NULL, cRubyPyFunction);
	
	Data_Get_Struct(rFunc, PObj, self);
	
	self->pObject = pFunc;
	
	return rFunc;
}


// 
// A wrapper class for Python functions and methods.
// 
// This is used internally to aid RubyPyClass in delegating method calls.
// 

inline void Init_RubyPyFunction()
{
	cRubyPyFunction = rb_define_class_under(mRubyPythonBridge,"RubyPyFunction", cRubyPyObject);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubypython-0.2.11 ext/rubypython_bridge/rp_function.c