Skip to content

Instantly share code, notes, and snippets.

@enebo
Created January 22, 2015 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save enebo/934a8d78252f51338e73 to your computer and use it in GitHub Desktop.
Save enebo/934a8d78252f51338e73 to your computer and use it in GitHub Desktop.
# ignores kwargs
if (rest)
postIndex = args.length - postCount;
elsif (preCount + optLength <= args.length)
postIndex = preCount + optLength
else
optCount = args.length - preCount - postCount
postIndex = preCount + optCount
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment