Add spec tests for new functionality and write rubydoc commentary