Skip to content

Instantly share code, notes, and snippets.

@dcarley
Created October 21, 2011 10:04
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 dcarley/1303492 to your computer and use it in GitHub Desktop.
Save dcarley/1303492 to your computer and use it in GitHub Desktop.
Oh, Ruby.
irb(main):001:0> def foo(one="one", two="two", three="three")
irb(main):002:1> "one: #{one}, two: #{two}, three: #{three}"
irb(main):003:1> end
=> nil
irb(main):004:0> foo()
=> "one: one, two: two, three: three"
irb(main):005:0> foo(three=3)
=> "one: 3, two: two, three: three"
irb(main):006:0> foo(three=3, two=2, one=1)
=> "one: 3, two: 2, three: 1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment