Skip to content

Instantly share code, notes, and snippets.

@abelmartin
Forked from caius/default_param_hack.rb
Created December 28, 2011 22:27
Show Gist options
  • Save abelmartin/1530132 to your computer and use it in GitHub Desktop.
Save abelmartin/1530132 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