# class Raven::StacktraceInterface::Frame

Not actually an interface, but I want to use the same style

### Attributes

abs_path[RW]
context_line[RW]
function[RW]
in_app[RW]
lineno[RW]
module[RW]
post_context[RW]
pre_context[RW]
vars[RW]

### Public Class Methods

new(*arguments) click to toggle source
Calls superclass method Raven::Interface.new

    # File lib/raven/interfaces/stack_trace.rb, line 31
    def initialize(*arguments)
      self.vars, self.pre_context, self.post_context = [], [], []
      super(*arguments)
    end

### Public Instance Methods

filename() click to toggle source

    # File lib/raven/interfaces/stack_trace.rb, line 36
    def filename
      return nil if self.abs_path.nil?

      prefix =
        if under_project_root? && in_app
          project_root
        elsif under_project_root?
          longest_load_path || project_root
        else
          longest_load_path
        end

      prefix ? self.abs_path[prefix.to_s.chomp(File::SEPARATOR).length+1..-1] : self.abs_path
    end

longest_load_path() click to toggle source

    # File lib/raven/interfaces/stack_trace.rb, line 59
    def longest_load_path
      $LOAD_PATH.select { |s| self.abs_path.start_with?(s.to_s) }.sort_by { |s| s.to_s.length }.last
    end

project_root() click to toggle source

    # File lib/raven/interfaces/stack_trace.rb, line 55
    def project_root
      @project_root ||= Raven.configuration.project_root && Raven.configuration.project_root.to_s
    end

to_hash(*args) click to toggle source
Calls superclass method Raven::Interface#to_hash

    # File lib/raven/interfaces/stack_trace.rb, line 63
    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

under_project_root?() click to toggle source

    # File lib/raven/interfaces/stack_trace.rb, line 51
    def under_project_root?
      project_root && abs_path.start_with?(project_root)
    end