Module: SyslogTls::LookupFromConst

Included in:
Facility, Severity
Defined in:
lib/syslog_tls/lookup_from_const.rb

Instance Method Summary collapse

Instance Method Details

#setup_constants(dst) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/syslog_tls/lookup_from_const.rb', line 17

def setup_constants(dst)
  constants.each do |pri|
    cval = const_get pri

    dst[pri] = cval
    dst[pri.downcase] = cval

    dst[:"LOG_#{pri.to_s}"] = cval
    dst[:"LOG_#{pri.downcase.to_s}"] = cval
    const_set :"LOG_#{pri.to_s}", cval

    dst[pri.to_s] = cval
    dst[pri.downcase.to_s] = cval

    dst[cval] = cval
    dst[cval.to_s] = cval
  end
end