Skip to content

Instantly share code, notes, and snippets.

@erainey
Forked from caius/default_param_hack.rb
Created January 24, 2013 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erainey/4623114 to your computer and use it in GitHub Desktop.
Save erainey/4623114 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