Class: MoonlogsRuby::Level
- Inherits:
-
Object
- Object
- MoonlogsRuby::Level
- Defined in:
- lib/moonlogs-ruby/models/level.rb
Constant Summary collapse
- TRACE =
'Trace'.freeze
- DEBUG =
'Debug'.freeze
- INFO =
'Info'.freeze
- WARN =
'Warn'.freeze
- ERROR =
'Error'.freeze
- FATAL =
'Fatal'.freeze
Instance Method Summary collapse
-
#build_from_hash(value) ⇒ String
Builds the enum from string.
Instance Method Details
#build_from_hash(value) ⇒ String
Builds the enum from string
26 27 28 29 30 |
# File 'lib/moonlogs-ruby/models/level.rb', line 26 def build_from_hash(value) constantValues = Level.constants.select { |c| Level::const_get(c) == value } raise "Invalid ENUM value #{value} for class #Level" if constantValues.empty? value end |