Class: LibvirtAsync::Implementations

Inherits:
Object
  • Object
show all
Includes:
WithDbg
Defined in:
lib/libvirt_async/implementations.rb

Instance Method Summary collapse

Constructor Details

#initializeImplementations

Returns a new instance of Implementations.



13
14
15
16
17
# File 'lib/libvirt_async/implementations.rb', line 13

def initialize
  dbg { "#{self.class}#initialize" }

  default_variables
end

Instance Method Details

#inspectObject



51
52
53
# File 'lib/libvirt_async/implementations.rb', line 51

def inspect
  to_s
end


34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/libvirt_async/implementations.rb', line 34

def print_debug_info
  str = [
      "#{self.class}:0x#{object_id.to_s(16)}",
      "handles = [",
      @handles.map(&:to_s).join("\n"),
      "]",
      "timers = [",
      @timers.map(&:to_s).join("\n"),
      "]"
  ].join("\n")
  LibvirtAsync.logger&.debug { str }
end

#startObject



19
20
21
22
23
# File 'lib/libvirt_async/implementations.rb', line 19

def start
  dbg { "#{self.class}#start" }

  register_implementations
end

#stopObject



25
26
27
28
29
30
31
32
# File 'lib/libvirt_async/implementations.rb', line 25

def stop
  dbg { "#{self.class}#stop" }

  @handles.each(&:unregister)
  @timers.each(&:unregister)

  default_variables
end

#to_sObject



47
48
49
# File 'lib/libvirt_async/implementations.rb', line 47

def to_s
  "#<#{self.class}:0x#{object_id.to_s(16)} handles=#{@handles} timers=#{@timers}>"
end