How can I count the number of values being passed as a splat argument while calling a method?
def splat_demo(*var)
#code to find out no of values in the splat variable here
end
You get an array so just run var.size
to get number of values that were passed in.