Update document.rb

Fixes #304