switch this to a case statement in a .select instead:

    .select do |m|
      severity, field = m.values_at('severity', 'field')
      switch
      case field == 'result'
         true
  end.map{ |m| m['text'].chomp }

The logic is too compact now