Class: Sai::ANSI::SequencedString::Segment::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/sai/ansi/sequenced_string.rb

Overview

Author:

Since:

  • 0.3.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(end_position:, start_position:) ⇒ Location

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.

Initialize a new instance of Location

Parameters:

Author:

Since:

  • 0.3.0



466
467
468
469
470
# File 'lib/sai/ansi/sequenced_string.rb', line 466

def initialize(end_position:, start_position:)
  @end_position = end_position
  @start_position = start_position
  freeze
end

Instance Attribute Details

#end_position ⇒ Integer (readonly) Also known as: end_pos

The ending position of the Location

Returns:

  • (Integer) —

    the end position

Author:

Since:

  • 0.3.0



440
441
442
# File 'lib/sai/ansi/sequenced_string.rb', line 440

def end_position
  @end_position
end

#start_position ⇒ Integer (readonly) Also known as: start_pos

The starting position of the Location

Returns:

  • (Integer) —

    the start position

Author:

Since:

  • 0.3.0



451
452
453
# File 'lib/sai/ansi/sequenced_string.rb', line 451

def start_position
  @start_position
end