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.



11
12
13
14
15
# File 'lib/libvirt_async/implementations.rb', line 11

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

  default_variables
end

Instance Method Details

#inspectObject



49
50
51
# File 'lib/libvirt_async/implementations.rb', line 49

def inspect
  to_s
end


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

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



17
18
19
20
21
# File 'lib/libvirt_async/implementations.rb', line 17

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

  register_implementations
end

#stopObject



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

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

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

  default_variables
end

#to_sObject



45
46
47
# File 'lib/libvirt_async/implementations.rb', line 45

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