egonSchiele/contracts.ruby — pull request #40 by chuckd (2014-05-23 01:18:18+00:00)
Title: Support an optional length argument to ArrayOf

This lets you specify the array argument to be of a fixed size.

Obviously you could list out each argument but it is a bit cumbersome on my project where the array can be between 5 and 60 required items.

I wonder if there's a better way to do this, but I couldn't see another built-in way and it seems like a common enough use case to include in the core gem.

@egonSchiele if you like this I can update the docs and tests.