Method: RubyPython::PyObject#setAttr

Defined in:
lib/rubypython/pyobject.rb

#setAttr(attrName, rbPyAttr) ⇒ Object

Sets an attribute of the wrapped Python object. Returns true if the attribute was successfully set.

attrName

The name of the attribute to set.

rbPyAttr

A PyObject wrapper around the value that we wish to set the

attribute to.



96
97
98
# File 'lib/rubypython/pyobject.rb', line 96

def setAttr(attrName, rbPyAttr)
  RubyPython::Python.PyObject_SetAttrString(@pointer, attrName, rbPyAttr.pointer) != -1
end