Class: SuperDiff::TieredLinesElider::Pane

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

Instance Method Summary collapse

Instance Method Details

#capped_to(beginning, ending) ⇒ Object



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

def capped_to(beginning, ending)
  new_beginning = range.begin < beginning ? beginning : range.begin
  new_ending = range.end > ending ? ending : range.end
  self.class.new(type: type, range: Range.new(new_beginning, new_ending))
end

#extended_to(new_end) ⇒ Object



342
343
344
# File 'lib/super_diff/tiered_lines_elider.rb', line 342

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

#paddedObject



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

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