Skip to content

Instantly share code, notes, and snippets.

@jzellman
Created January 31, 2012 18:07
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 jzellman/1711932 to your computer and use it in GitHub Desktop.
Save jzellman/1711932 to your computer and use it in GitHub Desktop.
Var Args 3
# Always returns true, ignores arguments
def always_true(*)
true
end
always_true
=> true
always_true(false)
=> true
# ignores all the args except the first
def ignore_rest(arg1, *)
arg1
end
ignore_rest("foo", "bar", "baz")
=> "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment