array to hash in ruby along with open class concept