How to re-factor this snippet? : I've just started working on ruby.. I've a function like below. I'm just wondering if there is a nice way to rewrite this piece. I did google and went through few documents, would like to know what would be the best thing to do there. I don't want this to be counted as so many lines of code increasing the complexity of my function.

    def test
        {
          testId: self.test_id,
          testTime: self.test_time,
          testType: self.test_type,
          city: self.city
......... many such variables 
        }
      end


