def find_alert(alert)
      id = Integer(alert) rescue nil # rubocop: disable RescueModifier
      list_alerts.find do |policy|
        return policy if id && policy['id'] == id
        policy['name'].casecmp(alert).zero?
      end
    end
def find_alert(alert)
      id = Integer(alert) rescue nil 
      list_alerts.find do |policy|
        return policy if id && policy['id'] == id
        policy['name'].casecmp(alert).zero?
      end
    end
def find_alert ( alert ) id = Integer ( alert ) rescue nil # rubocop: disable RescueModifier list_alerts . find do | policy | return policy if id && policy [ 'id' ] == id policy [ 'name' ] . casecmp ( alert ) . zero? end end
=> Find Matching Alert (Name or ID)
= > Find Matching Alert ( Name or ID )