Class: Errplane::Backtrace

Inherits:
Object
  • Object
show all
Defined in:
lib/errplane/backtrace.rb

Defined Under Namespace

Classes: Line

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(backtrace) ⇒ Backtrace

Returns a new instance of Backtrace.



25
26
27
28
29
30
31
32
# File 'lib/errplane/backtrace.rb', line 25

def initialize(backtrace)
  @lines = Array(backtrace).each.collect do |line|
    Errplane.configuration.backtrace_filters.each do |filter|
      line = filter.call(line)
    end
    Line.new(line)
  end
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



23
24
25
# File 'lib/errplane/backtrace.rb', line 23

def lines
  @lines
end

Instance Method Details

#inspectObject



38
39
40
# File 'lib/errplane/backtrace.rb', line 38

def inspect
  "<Backtrace: " + lines.collect { |line| line.to_s }.join(", ") + ">"
end

#to_aObject



34
35
36
# File 'lib/errplane/backtrace.rb', line 34

def to_a
  lines.map(&:to_s)
end