Module: Specinfra::Command::Module::Service::Delegator

Included in:
Base::Service, Specinfra::Command::Module::Systemd
Defined in:
lib/specinfra/command/module/service/delegator.rb

Instance Method Summary collapse

Instance Method Details

#def_delegator_service_under(under) ⇒ Object


6
7
8
9
10
11
12
13
14
15
# File 'lib/specinfra/command/module/service/delegator.rb', line 6

def def_delegator_service_under(under)
  self.send(:alias_method, :check_is_enabled, :"check_is_enabled_under_#{under}")
  self.send(:alias_method, :check_is_running, :"check_is_running_under_#{under}")
  self.send(:alias_method, :enable,           :"enable_under_#{under}")
  self.send(:alias_method, :disable,          :"disable_under_#{under}")
  self.send(:alias_method, :start,            :"start_under_#{under}")
  self.send(:alias_method, :stop,             :"stop_under_#{under}")
  self.send(:alias_method, :restart,          :"restart_under_#{under}")
  self.send(:alias_method, :reload,           :"reload_under_#{under}")
end