Class: ErrorLog::Model

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/error_log/model.rb

Constant Summary collapse

LEVELS =
{
   :debug => 0,
   :info  => 1,
   :warn  => 2,
   :warning  => 2,
   :error => 3,
   :fatal => 4,
   :wtf   => 5
}

Instance Method Summary collapse

Instance Method Details

#levelObject



20
21
22
# File 'lib/error_log/model.rb', line 20

def level
   LEVELS.invert[self.level_id]
end

#level=(name) ⇒ Object



24
25
26
# File 'lib/error_log/model.rb', line 24

def level=(name)
   self.level_id = LEVELS[name]
end