functions/default_params_standalone_parens.rb

tests/_examples/functions/default_params_standalone_parens.rb in the metorex repository.

def say(msg, times = 1)
  i = 0
  while i < times
    puts msg
    i = i + 1
  end
end

say "once"
say "twice", 2

Output:

once
twice
twice