Class: Libvirt::NetworkDhcpLease
- Defined in:
- lib/libvirt/network_dhcp_lease.rb
Instance Method Summary collapse
-
#initialize(pointer) ⇒ NetworkDhcpLease
constructor
A new instance of NetworkDhcpLease.
Methods inherited from BaseInfo
#[], struct_class, #to_h, #to_ptr
Constructor Details
#initialize(pointer) ⇒ NetworkDhcpLease
Returns a new instance of NetworkDhcpLease.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/libvirt/network_dhcp_lease.rb', line 8 def initialize(pointer) super free = ->(obj_id) do dbg { "Finalize Libvirt::NetworkDhcpLease object_id=0x#{obj_id.to_s(16)}, pointer=0x#{@ptr.address.to_s(16)}" } return unless @ptr warn "Couldn't free Libvirt::NetworkDhcpLease object_id=0x#{obj_id.to_s(16)}, pointer=0x#{@ptr.address.to_s(16)}" if FFI::Storage.virNetworkDHCPLeaseFree(@ptr).negative? end ObjectSpace.define_finalizer(self, free) end |