Class: Raven::StacktraceInterface::Frame
- Defined in:
- lib/raven/interfaces/stack_trace.rb
Overview
Not actually an interface, but I want to use the same style
Instance Attribute Summary collapse
-
#abs_path ⇒ Object
Returns the value of attribute abs_path.
-
#context_line ⇒ Object
Returns the value of attribute context_line.
-
#function ⇒ Object
Returns the value of attribute function.
-
#in_app ⇒ Object
Returns the value of attribute in_app.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
Instance Method Summary collapse
Methods inherited from Interface
Methods included from BetterAttrAccessor
Constructor Details
This class inherits a constructor from Raven::Interface
Instance Attribute Details
#abs_path ⇒ Object
Returns the value of attribute abs_path.
26 27 28 |
# File 'lib/raven/interfaces/stack_trace.rb', line 26 def abs_path @abs_path end |
#context_line ⇒ Object
Returns the value of attribute context_line.
31 32 33 |
# File 'lib/raven/interfaces/stack_trace.rb', line 31 def context_line @context_line end |
#function ⇒ Object
Returns the value of attribute function.
27 28 29 |
# File 'lib/raven/interfaces/stack_trace.rb', line 27 def function @function end |
#in_app ⇒ Object
Returns the value of attribute in_app.
33 34 35 |
# File 'lib/raven/interfaces/stack_trace.rb', line 33 def in_app @in_app end |
#lineno ⇒ Object
Returns the value of attribute lineno.
32 33 34 |
# File 'lib/raven/interfaces/stack_trace.rb', line 32 def lineno @lineno end |
Instance Method Details
#filename ⇒ Object
35 36 37 38 39 40 |
# File 'lib/raven/interfaces/stack_trace.rb', line 35 def filename return nil if self.abs_path.nil? prefix = $LOAD_PATH.select { |s| self.abs_path.start_with?(s.to_s) }.sort_by { |s| s.to_s.length }.last prefix ? self.abs_path[prefix.to_s.chomp(File::SEPARATOR).length+1..-1] : self.abs_path end |
#to_hash(*args) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/raven/interfaces/stack_trace.rb', line 42 def to_hash(*args) data = super(*args) data['filename'] = self.filename data.delete('vars') unless self.vars && !self.vars.empty? data.delete('pre_context') unless self.pre_context && !self.pre_context.empty? data.delete('post_context') unless self.post_context && !self.post_context.empty? data.delete('context_line') unless self.context_line && !self.context_line.empty? data end |