The Ruby &&= operator assigns something if the expression is non-nil.
This is dangerous Perlish style coding!
You should be really clear what your code does with your data. If inputs are faulty, an error should happen.
What I mean is: catch errors as early as possible in the source, so it is clear what the cause is. You are throwing exceptions, but it is not clear what the cause is of the error. It can be much more stringent - and helpful for people using your code.
The Ruby &&= operator assigns something if the expression is non-nil.
This is dangerous Perlish style coding!
You should be really clear what your code does with your data. If inputs are faulty, an error should happen.
What I mean is: catch errors as early as possible in the source, so it is clear what the cause is. You are throwing exceptions, but it is not clear what the cause is of the error. It can be much more stringent - and helpful for people using your code.