def does_match?(msg, conditions)

      return true unless conditions

      conditions.each do |k, v|

        return false unless Array(v).find do |vv|

          # the Array(v) is for backward compatibility, although newer
          # track conditions are already stored as arrays.

          vv = Ruote.regex_or_s(vv)

          val = case k

            when 'class' then msg['error']['class']
            when 'message' then msg['error']['message']

            else Ruote.lookup(msg, k)
          end

          val && (vv.is_a?(Regexp) ? vv.match(val) : vv == val)
        end
      end

      true
    end
def does_match?(msg, conditions)

      return true unless conditions

      conditions.each do |k, v|

        return false unless Array(v).find do |vv|

          # the Array(v) is for backward compatibility, although newer
          # track conditions are already stored as arrays.

          vv = Ruote.regex_or_s(vv)

          val = case k

            when 'class' then msg['error']['class']
            when 'message' then msg['error']['message']

            else Ruote.lookup(msg, k)
          end

          val && (vv.is_a?(Regexp) ? vv.match(val) : vv == val)
        end
      end

      true
    end
Given a msg and a hash of conditions, returns true if the msg
 matches the conditions.