Skip to content

Instantly share code, notes, and snippets.

@deathbob
Forked from caius/default_param_hack.rb
Created December 28, 2011 19:14
Show Gist options
  • Save deathbob/1529235 to your computer and use it in GitHub Desktop.
Save deathbob/1529235 to your computer and use it in GitHub Desktop.
def output name=((default=true); "caius")
puts "name: #{name.inspect}"
puts "default: #{default.inspect}"
end
output
# >> name: "caius"
# >> default: true
output "avdi"
# >> name: "avdi"
# >> default: nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment