Class: StackDeck::Frame::Ruby

Inherits:
StackDeck::Frame show all
Defined in:
lib/stackdeck/frame.rb

Instance Attribute Summary

Attributes inherited from StackDeck::Frame

#clue, #filename, #function, #lineno

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StackDeck::Frame

#context, #context?, #initialize, #language, #same_line?

Constructor Details

This class inherits a constructor from StackDeck::Frame

Class Method Details

.extract(backtrace) ⇒ Object



68
69
70
# File 'lib/stackdeck/frame.rb', line 68

def self.extract(backtrace)
  backtrace.map {|s| StackDeck::Frame::Ruby.parse(s) }
end

.parse(str) ⇒ Object



63
64
65
66
67
# File 'lib/stackdeck/frame.rb', line 63

def self.parse(str)
  if str =~ /(.*?):(\d+)(:in `(.*)')?/
    new($4, $1, $2.to_i)
  end
end

Instance Method Details

#boundary?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/stackdeck/frame.rb', line 72

def boundary?
  filename == __FILE__ && function == 'boundary'
end

#to_sObject



75
76
77
78
79
80
81
# File 'lib/stackdeck/frame.rb', line 75

def to_s
  if function && function != ''
    "#{filename}:#{lineno}:in `#{function}'"
  else
    "#{filename}:#{lineno}"
  end
end