Class: Diff::Display::Block

Inherits:
Array
  • Object
show all
Defined in:
lib/diff/display/data_structure.rb

Overview

This class is an array which contains Line objects. Just like Line classes, several Block classes inherit from Block. If all the lines in the block are added lines then it is an AddBlock. If all lines in the block are removed lines then it is a RemBlock. If the lines in the block are all unmodified then it is an UnMod block. If the lines in the block are a mixture of added and removed lines then it is a ModBlock. There are no blocks that contain a mixture of modified and unmodified lines.

Class Method Summary collapse

Class Method Details

.addObject



174
# File 'lib/diff/display/data_structure.rb', line 174

def add;    AddBlock.new    end

.headerObject



178
# File 'lib/diff/display/data_structure.rb', line 178

def header; HeaderBlock.new end

.modObject



176
# File 'lib/diff/display/data_structure.rb', line 176

def mod;    ModBlock.new    end

.nonewlineObject



179
# File 'lib/diff/display/data_structure.rb', line 179

def nonewline; NonewlineBlock.new end

.remObject



175
# File 'lib/diff/display/data_structure.rb', line 175

def rem;    RemBlock.new    end

.unmodObject



177
# File 'lib/diff/display/data_structure.rb', line 177

def unmod;  UnModBlock.new  end