class Pry::Command::Cat::ExceptionFormatter - pry-0.10.1 Documentation

# class Pry::Command::Cat::ExceptionFormatter

### Attributes

_pry_[R]
ex[R]
opts[R]

### Public Class Methods

new(exception, _pry_, opts) click to toggle source

    # File lib/pry/commands/cat/exception_formatter.rb, line 8
    def initialize(exception, _pry_, opts)
      @ex = exception
      @opts = opts
      @_pry_ = _pry_
    end

### Public Instance Methods

format() click to toggle source

    # File lib/pry/commands/cat/exception_formatter.rb, line 14
    def format
      check_for_errors
      set_file_and_dir_locals(backtrace_file, _pry_, _pry_.current_context)
      code = decorate(Pry::Code.from_file(backtrace_file).
                                  between(*start_and_end_line_for_code_window).
                                  with_marker(backtrace_line))
      "#{header}#{code}"
    end