class Pry::Command::Cat::AbstractFormatter

Private Instance Methods

between_lines() click to toggle source
# File lib/pry/commands/cat/abstract_formatter.rb, line 26
def between_lines
  [opts[:start] || 1, opts[:end] || -1]
end
code_type() click to toggle source
# File lib/pry/commands/cat/abstract_formatter.rb, line 18
def code_type
  opts[:type] || :ruby
end
decorate(content) click to toggle source
# File lib/pry/commands/cat/abstract_formatter.rb, line 12
def decorate(content)
  content.code_type = code_type
  content.between(*between_lines)
    .with_line_numbers(use_line_numbers?).highlighted
end
use_line_numbers?() click to toggle source
# File lib/pry/commands/cat/abstract_formatter.rb, line 22
def use_line_numbers?
  opts.present?(:'line-numbers') || opts.present?(:ex)
end