Class Diff::LCS::ContextChange
In: lib/diff/lcs/change.rb
Parent: Object

Represents a contextual change. Contains the position and values of the elements in the old and the new sequenced enumerables as well as the action taken.

Methods

<=>   ==   from_a   inspect   new   simplify   to_a  

Included Modules

Comparable Diff::LCS::ChangeTypeTests

Attributes

action  [R]  Returns the action this Change represents. Can be ’+’ (adding?), ’-’ (deleting?), ’=’ (unchanged?), # or ’!’ (changed?). When created by Diff::LCS#diff or Diff::LCS#sdiff, it may also be ’>’ (finished_a?) or ’<’ (finished_b?).
new_element  [R] 
new_position  [R] 
old_element  [R] 
old_position  [R] 

Public Class methods

Creates a ContextChange from an array produced by ContextChange#to_a.

Simplifies a context change for use in some diff callbacks. ’<’ actions are converted to ’-’ and ’>’ actions are converted to ’+’.

Public Instance methods

[Validate]