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」:字符串 –