Class: PyBind::PySet
- Includes:
- PyObjectWrapper
- Defined in:
- lib/pybind/types/set.rb
Constant Summary
Constants included from Operator
Operator::BINARY_OPERATION_OPFUNCS, Operator::UNARY_OPERATION_OPFUNCS
Constants included from RichComparer
RichComparer::Py_EQ, RichComparer::Py_GE, RichComparer::Py_GT, RichComparer::Py_LE, RichComparer::Py_LT, RichComparer::Py_NE, RichComparer::RICH_COMPARISON_OPCODES
Instance Method Summary collapse
- #include?(obj) ⇒ Boolean
-
#initialize(init) ⇒ PySet
constructor
A new instance of PySet.
- #size ⇒ Object
Methods included from PyObjectWrapper
#autocall_method_missing, #call, included, #inspect, #methods, #python_type, #to_python_struct, #to_s
Methods included from Operator
#!, #**, #<=>, #===, #__binary_operate__, #__unary_operate__
Methods included from RichComparer
Methods included from AttrAccessor
#[], #[]=, #get_attribute, #has_attribute?, #remove_attribute, #set_attribute
Constructor Details
#initialize(init) ⇒ PySet
Returns a new instance of PySet.
6 7 8 |
# File 'lib/pybind/types/set.rb', line 6 def initialize(init) super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PyBind::PyObjectWrapper
Instance Method Details
#include?(obj) ⇒ Boolean
14 15 16 17 |
# File 'lib/pybind/types/set.rb', line 14 def include?(obj) obj = obj.to_python LibPython.PySet_Contains(@pystruct, obj) == 1 end |
#size ⇒ Object
10 11 12 |
# File 'lib/pybind/types/set.rb', line 10 def size LibPython.PySet_Size(@pystruct) end |