Module: CF::Memory
- Included in:
- Base
- Defined in:
- lib/corefoundation/memory.rb
Overview
Provides a more declarative way to define all required abstract methods. This gets included in the CF::Base class whose subclasses then need to define those methods.
Instance Method Summary collapse
-
#inspect ⇒ String
Returns a ruby string containing the output of CFCopyDescription for the wrapped object.
-
#release ⇒ Object
Calls CFRelease on the wrapped pointer.
-
#retain ⇒ Object
Calls CFRetain on the wrapped pointer.
-
#to_ptr ⇒ FFI::Pointer
Returns the wrapped pointer.
Instance Method Details
#inspect ⇒ String
Returns a ruby string containing the output of CFCopyDescription for the wrapped object
20 21 22 |
# File 'lib/corefoundation/memory.rb', line 20 def inspect CF::String.new(CF.CFCopyDescription(self)).to_s end |
#release ⇒ Object
Calls CFRelease on the wrapped pointer
27 28 29 30 |
# File 'lib/corefoundation/memory.rb', line 27 def release CF.release(self) self end |
#retain ⇒ Object
Calls CFRetain on the wrapped pointer
35 36 37 38 |
# File 'lib/corefoundation/memory.rb', line 35 def retain CF.retain(self) self end |
#to_ptr ⇒ FFI::Pointer
Returns the wrapped pointer
43 44 45 |
# File 'lib/corefoundation/memory.rb', line 43 def to_ptr ptr end |