Class: Prism::Merge::FileAligner::Boundary

Inherits:
Struct
  • Object
show all
Defined in:
lib/prism/merge/file_aligner.rb

Overview

Represents a boundary where files differ

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dest_rangeObject

Returns the value of attribute dest_range

Returns:

  • (Object)

    the current value of dest_range



30
31
32
# File 'lib/prism/merge/file_aligner.rb', line 30

def dest_range
  @dest_range
end

#next_anchorObject

Returns the value of attribute next_anchor

Returns:

  • (Object)

    the current value of next_anchor



30
31
32
# File 'lib/prism/merge/file_aligner.rb', line 30

def next_anchor
  @next_anchor
end

#prev_anchorObject

Returns the value of attribute prev_anchor

Returns:

  • (Object)

    the current value of prev_anchor



30
31
32
# File 'lib/prism/merge/file_aligner.rb', line 30

def prev_anchor
  @prev_anchor
end

#template_rangeObject

Returns the value of attribute template_range

Returns:

  • (Object)

    the current value of template_range



30
31
32
# File 'lib/prism/merge/file_aligner.rb', line 30

def template_range
  @template_range
end

Instance Method Details

#dest_linesArray<Integer>

Returns Array of line numbers in destination file within this boundary.

Returns:

  • (Array<Integer>)

    Array of line numbers in destination file within this boundary



38
39
40
41
# File 'lib/prism/merge/file_aligner.rb', line 38

def dest_lines
  return [] unless dest_range
  (dest_range.begin..dest_range.end).to_a
end

#template_linesArray<Integer>

Returns Array of line numbers in template file within this boundary.

Returns:

  • (Array<Integer>)

    Array of line numbers in template file within this boundary



32
33
34
35
# File 'lib/prism/merge/file_aligner.rb', line 32

def template_lines
  return [] unless template_range
  (template_range.begin..template_range.end).to_a
end