1
0
mirror of https://github.com/meineerde/rackstash.git synced 2026-02-01 01:37:12 +00:00

Add documentation for Rackstash.severity_label

This commit is contained in:
Holger Just 2017-08-04 16:05:36 +02:00
parent 3dc3302794
commit f4ca82011f

View File

@ -45,6 +45,13 @@ module Rackstash
'ANY'.freeze
].freeze
# Gets the label for a given severity. You can specify the severity either by
# its numeric value or its name in most variations (`Symbol`, `String`,
# different cases).
#
# @param severity [Integer, #to_s] A numeric value of one of the {SEVERITIES}
# or a {SEVERITY_NAMES} key
# @return [String] one of the {SEVERITY_LABELS}
def self.severity_label(severity)
if severity.is_a?(Integer)
return SEVERITY_LABELS.last if severity < 0