Closed adrianshort closed 5 years ago
One way to do this might be to use method chaining instead of throwing a hash parameter at the scrape method.
eg. auth.validated_days(7).keywords('electric vehicle').scrape
Wrapping each parameter in its own method would be a good way of organising the code internally. And by definition the parameters would be enforced because using a non-existent parameter would throw a NoMethodError
exception.
Currently the scrape params are in a hash that doesn't get checked. The user has no way of knowing which of them have affected their scrape results.
We should check the params and raise an exception if an invalid parameter is present.