Class: Pry::Code::CodeRange Private

Inherits:
Object show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/code/code_range.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a range of lines in a code listing.

Instance Method Summary collapse

Constructor Details

#initialize(start_line, end_line = nil) ⇒ CodeRange

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CodeRange.

Parameters:



11
12
13
14
15
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/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

Instance Method Details

#indices_range(lines) ⇒ Range

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

Returns:



19
20
21
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/code/code_range.rb', line 19

def indices_range(lines)
  Range.new(*indices(lines))
end