Class: Yast::ServicesProposalClass

Inherits:
Module
  • Object
show all
Includes:
Logger
Defined in:
library/runlevel/src/modules/ServicesProposal.rb

Instance Method Summary collapse

Constructor Details

#initializeServicesProposalClass



36
37
38
# File 'library/runlevel/src/modules/ServicesProposal.rb', line 36

def initialize
  @services = {}
end

Instance Method Details

#disable_service(service) ⇒ Object

Marks the given service as disabled



55
56
57
58
# File 'library/runlevel/src/modules/ServicesProposal.rb', line 55

def disable_service(service)
  check_service(service)
  @services[service] = :disabled
end

#disabled_servicesArray <String>

Returns all services currently marked as disabled



70
71
72
# File 'library/runlevel/src/modules/ServicesProposal.rb', line 70

def disabled_services
  @services.select { |_service, status| status == :disabled }.keys
end

#enable_service(service) ⇒ Object

Marks the given service as enabled



47
48
49
50
# File 'library/runlevel/src/modules/ServicesProposal.rb', line 47

def enable_service(service)
  check_service(service)
  @services[service] = :enabled
end

#enabled_servicesArray <String>

Returns all services currently marked as enabled



63
64
65
# File 'library/runlevel/src/modules/ServicesProposal.rb', line 63

def enabled_services
  @services.select { |_service, status| status == :enabled }.keys
end

#resetObject



40
41
42
# File 'library/runlevel/src/modules/ServicesProposal.rb', line 40

def reset
  @services = {}
end