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

Represents a simplistic (non-contextual) change. Represents the removal or addition of an element from either the old or the new sequenced enumerable.

Methods

<=>   ==   adding?   changed?   deleting?   finished_a?   finished_b?   from_a   inspect   new   to_a   unchanged?   valid_action?  

Included Modules

Comparable

Constants

VALID_ACTIONS = %W(+ - = ! > <)   The only actions valid for changes are ’+’ (add), ’-’ (delete), ’=’ (no change), ’!’ (changed), ’<’ (tail changes from first sequence), or ’>’ (tail changes from second sequence). The last two (’<>’) are only found with Diff::LCS::diff and Diff::LCS::sdiff.

Attributes

action  [R]  Returns the action this Change represents.
element  [R]  Returns the sequence element of the Change.
position  [R]  Returns the position of the Change.

Public Class methods

Public Instance methods

[Validate]