class Pry::Code::CodeRange - pry-0.10.1 Documentation

# class Pry::Code::CodeRange

Represents a range of lines in a code listing.

@api private

### Public Class Methods

new(start_line, end_line = nil) click to toggle source

@param [Integer] start_line @param [Integer?] end_line

    # File lib/pry/code/code_range.rb, line 11
    def initialize(start_line, end_line = nil)
      @start_line = start_line
      @end_line   = end_line
      force_set_end_line
    end

### Public Instance Methods

indices_range(lines) click to toggle source

@param [Array<LOC>] lines @return [Range]

    # File lib/pry/code/code_range.rb, line 19
    def indices_range(lines)
      Range.new(*indices(lines))
    end