def convert_value_to_ostruct(data)
      case data
      when Hash
        self.class.new(data)
      when Array
        data.collect{|val| self.convert_value_to_ostruct(val)}
      else
        data
      end
    end
def convert_value_to_ostruct(data)
      case data
      when Hash
        self.class.new(data)
      when Array
        data.collect{|val| self.convert_value_to_ostruct(val)}
      else
        data
      end
    end
convert a value to a Ostruct (where necessary)