Class: PyCall::Set
- Inherits:
-
Object
- Object
- PyCall::Set
- Includes:
- PyObjectWrapper
- Defined in:
- lib/pycall/set.rb
Constant Summary
Constants included from PyObjectWrapper
PyObjectWrapper::OPERATOR_METHOD_NAMES
Instance Attribute Summary
Attributes included from PyObjectWrapper
Instance Method Summary collapse
- #include?(obj) ⇒ Boolean
-
#initialize(pyobj) ⇒ Set
constructor
A new instance of Set.
- #size ⇒ Object (also: #length)
Methods included from PyObjectWrapper
#[], #[]=, #call, #coerce, #dup, extend_object, #inspect, #kind_of?, #method_missing, #respond_to_missing?, #to_f, #to_i, #to_s
Constructor Details
#initialize(pyobj) ⇒ Set
Returns a new instance of Set.
5 6 7 |
# File 'lib/pycall/set.rb', line 5 def initialize(pyobj) super(pyobj) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PyCall::PyObjectWrapper
Instance Method Details
#include?(obj) ⇒ Boolean
15 16 17 |
# File 'lib/pycall/set.rb', line 15 def include?(obj) 1 == LibPython.PySet_Contains(__pyobj__, Conversions.from_ruby(obj)) end |
#size ⇒ Object Also known as: length
9 10 11 |
# File 'lib/pycall/set.rb', line 9 def size LibPython.PySet_Size(__pyobj__) end |