ruby design pattern