Skip to content

Instantly share code, notes, and snippets.

@mhorbul
Created January 14, 2011 20:29
Show Gist options
  • Save mhorbul/780175 to your computer and use it in GitHub Desktop.
Save mhorbul/780175 to your computer and use it in GitHub Desktop.
def foo(arg1, arg2, *arg3)
@arg1 = arg1
@arg2 = arg2
@arg3 = arg3
end
def bar(arg1, arg2, arg3 = nil)
@arg1 = arg1
@arg2 = arg2
@arg3 = (arg3.is_a?(Array) ? arg3 : [arg3]).compact
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment