Class: Backtrace

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/backtrace.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find_or_create(attributes = {}) ⇒ Object


17
18
19
# File 'app/models/backtrace.rb', line 17

def self.find_or_create(attributes = {})
  new(attributes).similar || create(attributes)
end

Instance Method Details

#raw=(raw) ⇒ Object


25
26
27
28
29
# File 'app/models/backtrace.rb', line 25

def raw=(raw)
  raw.compact.each do |raw_line|
    lines << BacktraceLine.new(BacktraceLineNormalizer.new(raw_line).call)
  end
end

#similarObject


21
22
23
# File 'app/models/backtrace.rb', line 21

def similar
  Backtrace.where(:fingerprint => fingerprint).first
end