我正在定义一个提供者,如下所示:
action :start do
...
end
action :stop do
...
end
action :restart do
...
end
现在,我不想重写stop
and start
in的实现restart
,而是想调用action :stop
然后action :start
in action :restart
,如下所示:
action :restart do
action :stop
action :start
end
有没有办法做到这一点?
编辑- 如 Coderanger 回答中所述,解决方案是:
action :restart do
action_stop
action_start
end