I just saw this code:
method_name(ARGV.shift || "somefile.txt")
which basically should first evalute ARGV[0]
and if it doesn't exist then read from "somefile.txt".
My question was, can the &&
operator be also used here, and in what situations?
Also, does this concept of "passing this or this argument" to a method in Ruby have a name?