Class: DL::PtrData

Class DL::PtrData |
In: | lib/sqlite3/driver/dl/driver.rb
Parent: | Object

Methods

- set_object
- to_object

Public Instance methods
set_object(obj)

[ show source ]

        # File lib/sqlite3/driver/dl/driver.rb, line 54
    54:   def set_object(obj)
    55:     self[0] = [obj.object_id].pack("L")
    56:   end

to_object()

The inverse of the Kernel#to_ptr operation.

[ show source ]

        # File lib/sqlite3/driver/dl/driver.rb, line 48
    48:   def to_object
    49:     n = to_s(4).unpack("L").first
    50:     return nil if n < 1
    51:     ObjectSpace._id2ref(n) rescue self.to_s
    52:   end

[Validate]