Library control exercise using Ruby