In this publication titled ruby check if string contains, I have provided a complete image from start to finish ,Please look below