ruby code for doc