Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
メソッドの呼び出し中に splat 引数として渡される値の数をカウントするにはどうすればよいですか?
def splat_demo(*var) #code to find out no of values in the splat variable here end
配列を取得するので、実行var.sizeして渡された値の数を取得します。
var.size