Class: SuperDiff::Core::TieredLinesElider::Pane

Inherits:
Object
  • Object
show all
Defined in:
lib/super_diff/core/tiered_lines_elider.rb

Instance Method Summary collapse

Instance Method Details

#capped_to(beginning, ending) ⇒ Object



355
356
357
358
359
360
361
362
# File 'lib/super_diff/core/tiered_lines_elider.rb', line 355

def capped_to(beginning, ending)
  new_beginning = [range.begin, beginning].max
  new_ending = [range.end, ending].min
  self.class.new(
    type: type,
    range: Range.new(new_beginning, new_ending)
  )
end

#extended_to(new_end) ⇒ Object



347
348
349
# File 'lib/super_diff/core/tiered_lines_elider.rb', line 347

def extended_to(new_end)
  self.class.new(type: type, range: range.begin..new_end)
end

#paddedObject



351
352
353
# File 'lib/super_diff/core/tiered_lines_elider.rb', line 351

def padded
  self.class.new(type: type, range: Range.new(range.begin, range.end))
end