Module: DInstaller::DBus::WithServiceStatus

Included in:
Manager, Software::Manager, Storage::Proposal, Users
Defined in:
lib/dinstaller/dbus/with_service_status.rb

Overview

Mixin to be included by D-Bus objects that needs to register a service status

Instance Method Summary collapse

Instance Method Details

#busy_while(&block) ⇒ Object

Sets the service status to busy meanwhile the given block is running

Parameters:

  • block (Proc)

Returns:

  • (Object)

    the result of the given block



39
40
41
42
43
44
45
# File 'lib/dinstaller/dbus/with_service_status.rb', line 39

def busy_while(&block)
  service_status.busy
  result = block.call
  service_status.idle

  result
end

#service_statusServiceStatus

Service status

Returns:



31
32
33
# File 'lib/dinstaller/dbus/with_service_status.rb', line 31

def service_status
  @service_status ||= ServiceStatus.new.idle
end