Module HashInit could support a predefined range of values for each option.
For example, if I'm using this module to instantiate a class :clap:, I would also like to say that option foo should only accept values "bar"and "baz". Anything different from that should trigger an error.
This should help make sure that our objects get created correctly and also reduce the amount of boilerplate code in the classes themselves (testing whether an option is set, checking whether it has the right types and so on.)
Module
HashInit
could support a predefined range of values for each option.For example, if I'm using this module to instantiate a class :clap:, I would also like to say that option
foo
should only accept values"bar"
and"baz"
. Anything different from that should trigger an error.This should help make sure that our objects get created correctly and also reduce the amount of boilerplate code in the classes themselves (testing whether an option is set, checking whether it has the right types and so on.)