An interesting question is not how the code works: if args not passed, the not_set = true code will be evaluated.
Rather, the important question is: why would someone go to this problem ? After all, a much simpler alternative usually works very well:
def arguments(args = nil) if args.nil? ... else ... end end
However, this approach does not distinguish between these two calls:
arguments() arguments(nil)
If this difference matters, you can use an approach like the one you posted.
source share