I will change this but for future reference === is same as is_a. I was trying to check   rule.is_a?(Array)  here..