summaryrefslogtreecommitdiffstats
path: root/storage/mroonga/vendor/groonga/lib/mrb/scripts/context/error_level.rb
diff options
context:
space:
mode:
Diffstat (limited to 'storage/mroonga/vendor/groonga/lib/mrb/scripts/context/error_level.rb')
-rw-r--r--storage/mroonga/vendor/groonga/lib/mrb/scripts/context/error_level.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/scripts/context/error_level.rb b/storage/mroonga/vendor/groonga/lib/mrb/scripts/context/error_level.rb
new file mode 100644
index 00000000..c0685f16
--- /dev/null
+++ b/storage/mroonga/vendor/groonga/lib/mrb/scripts/context/error_level.rb
@@ -0,0 +1,30 @@
+module Groonga
+ class Context
+ class ErrorLevel
+ @@names = {}
+
+ class << self
+ def find(name)
+ @@names[name]
+ end
+ end
+
+ attr_reader :name
+ def initialize(name, level)
+ @@names[name] = self
+ @name = name
+ @level = level
+ end
+
+ def to_i
+ @level
+ end
+
+ EMERGENCY = new(:emergency, 1)
+ ALERT = new(:alert, 2)
+ CRITICAL = new(:critical, 3)
+ ERROR = new(:error, 4)
+ WARNING = new(:warning, 5)
+ end
+ end
+end