Ruby Language Required default optional parameter mix


Example

def my_mix(name,valid=true, *opt)
    puts name
    puts valid
    puts opt
end

Call as follows:

my_mix('me')
# 'me'
# true
# []

my_mix('me', false)
# 'me'
# false
# []

my_mix('me', true, 5, 7) 
# 'me'
# true
# [5,7]