Allow non-array as type

Related to #9.

This is probably the worst ruby ever written, but I can change this
if you suggest something better.