Class: PyBind::PyObjectStruct
- Defined in:
- lib/pybind/struct.rb,
lib/pybind/typecast.rb
Class Method Summary collapse
Instance Method Summary collapse
- #kind_of?(klass) ⇒ Boolean
- #none? ⇒ Boolean
- #to_python_struct ⇒ Object (also: #to_python)
- #to_ruby ⇒ Object
- #to_ruby_object ⇒ Object
Class Method Details
.null ⇒ Object
8 9 10 |
# File 'lib/pybind/struct.rb', line 8 def self.null new(FFI::Pointer::NULL) end |
Instance Method Details
#kind_of?(klass) ⇒ Boolean
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pybind/struct.rb', line 16 def kind_of?(klass) case klass when PyBind::PyObjectStruct value = LibPython.PyObject_IsInstance(self, klass) raise PyError.fetch if value == -1 value == 1 else super end end |
#none? ⇒ Boolean
12 13 14 |
# File 'lib/pybind/struct.rb', line 12 def none? PyBind.None.to_ptr == to_ptr end |
#to_python_struct ⇒ Object Also known as: to_python
31 32 33 |
# File 'lib/pybind/struct.rb', line 31 def to_python_struct self end |
#to_ruby ⇒ Object
24 25 26 |
# File 'lib/pybind/typecast.rb', line 24 def to_ruby TypeCast.from_python(self) end |