Skip to content

Instantly share code, notes, and snippets.

@stephenprater
Created April 22, 2011 15:48
Show Gist options
  • Save stephenprater/936919 to your computer and use it in GitHub Desktop.
Save stephenprater/936919 to your computer and use it in GitHub Desktop.
muhahahah
x = lambda do |*args|
row, col = *({ :row => nil, :col => nil}.merge(args.first).values rescue args)
end
x.call(4,2) => [4,2]
x.call(row:4, col:2) => [4,2]
x.call(row:4) => [4,nil]
x.call(4) => [4,nil]
x.call(col:2) => [nil,2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment