Skip to content

Instantly share code, notes, and snippets.

@rylev
Created September 24, 2013 13:49
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 rylev/6685033 to your computer and use it in GitHub Desktop.
Save rylev/6685033 to your computer and use it in GitHub Desktop.
Enforcing arity like a boss
def foo(args)
raise ArgumentError unless args.count == 2 && args.keys.include? :bar
# your code goes here
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment