Method: RubyPython::RubyPyClass#new

Defined in:
lib/rubypython/rubypyproxy.rb

#new(*args) ⇒ Object

Create an instance of the wrapped class. This is a workaround for the fact that Python classes are meant to be callable.



200
201
202
203
204
205
206
207
208
# File 'lib/rubypython/rubypyproxy.rb', line 200

def new(*args)
  args = PyObject.convert(*args)
  pTuple = PyObject.buildArgTuple(*args)
  pReturn = @pObject.callObject(pTuple)
  if PythonError.error?
    raise PythonError.handle_error
  end
  RubyPyInstance.new pReturn
end