Class: ExceptionEngine::Data

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
app/models/exception_engine/data.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.store!(args) ⇒ Object



10
11
12
13
14
# File 'app/models/exception_engine/data.rb', line 10

def self.store!(args)
  data = new
  data.parse(args)
  data.save!
end

Instance Method Details

#parse(notice) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/models/exception_engine/data.rb', line 16

def parse(notice)
  self.error_class = notice.error_class 
  self.error_message = notice.error_message
  if !notice.backtrace.lines.empty?
    notice.backtrace.lines.each do | line | 
      if !line.nil?
        b             = ExceptionEngine::BacktraceData.new
        b.line_num    = line.number
        b.file        = line.file
        b.ruby_method = line.method
        self.backtraces << b
      end
    end
  end
  self.created_at = Time.now.utc
end