0
我希望有人能帮助我。Ruby如何扩展接受新参数的方法
我有红宝石此方法:
def puppetrun_oneClass!
ProxyAPI::Puppet.new({:url => puppet_proxy.url}).runSingle fqdn
end
然后我此另一种方法中调用:
def update_multiple_puppetrun_oneClass_deploy
if @hosts.map(&:puppetrun_oneClass!).uniq == [true]
notice "Successfully executed, check reports and/or log files for more details"
else
error "Some or all hosts execution failed, Please check log files for more information"
end
end
其中@hosts是主机名的阵列。
现在,我想扩展puppetrun_oneClass!接受@myDeploy参数,其中@myDeploy参数是一个包含字符串的变量。
我该怎么做?那么我应该如何调用修改的方法?
谢谢!
嗨@tadman!是!我的代码现在正在工作!非常感谢! – MrTeleBird 2013-05-14 06:55:33