0
我为了发送参数的Ruby程序试图验证码:如何发送参数的Ruby程序
namespace :tnx do
require_relative "transactions.rb"
include Cnp_transactions_modes
task :generate, [:clean_all] => [:environment] do |t, args|
if args[: clean_all] == 'true'
// something
end
if args[:times]
Cnp_transactions_modes.create_tnx(args[:times])
else
puts "\nSet some number\n"
end
end
end
当我运行的代码是这样的:
bundle exec rake test:generate['true','30']
我得到Set some number
你能给我一些建议,我如何修复代码?
我得到NoMethodError:未定义的方法'时报的 “30”:字符串 –
尝试捆绑高管耙TNX:产生[”真'',30] – gates
我得到NoMethodError:未定义的方法'时代'为“30”:字符串 –