Sha256: 9edd8e8334a6ed2e28bdf01922424a60c6c191028b8535de91a06a469d1f2546
Contents?: true
Size: 602 Bytes
Versions: 14
Compression:
Stored size: 602 Bytes
Contents
module RubyPython # Creates a Ruby class that inherits from a proxied Python object. def self.Type(name) mod, match, klass = name.rpartition(".") pymod = RubyPython.import(mod) pyclass = pymod.pObject.getAttr(klass) rclass = Class.new(RubyPyProxy) do define_method(:initialize) do |*args| args = PyObject.convert(*args) pTuple = PyObject.buildArgTuple(*args) pReturn = pyclass.callObject(pTuple) if PythonError.error? raise PythonError.handle_error end @pObject = pReturn end end return rclass end end
Version data entries
14 entries across 14 versions & 3 rubygems