add method in hash to validade required and optional attributes
replacing old validation lib by hash assert_required_keys