変数が整数かどうかをテストしようとしています。コードは次のとおりです。
if (params[:int1].is_a?(Integer) && params[:int2].is_a?(Integer))
add(params[:int1], params[:int2])
else
puts "Need two integers"
end
それがうまくいかない理由を知っているなら、あなたは私のすべての注目を集めています.
変数が整数かどうかをテストしようとしています。コードは次のとおりです。
if (params[:int1].is_a?(Integer) && params[:int2].is_a?(Integer))
add(params[:int1], params[:int2])
else
puts "Need two integers"
end
それがうまくいかない理由を知っているなら、あなたは私のすべての注目を集めています.