Object
Represents a simplistic (non-contextual) change. Represents the removal or addition of an element from either the old or the new sequenced enumerable.
Returns the action this Change represents. Can be ’+’ (#), ’-’ (#), ’=’ (#), # or ’!’ (#). When created by Diff::LCS#diff or Diff::LCS#sdiff, it may also be ’>’ (#) or ’<’ (#).
# File lib/diff/lcs/change.rb, line 63
63: def <=>(other)
64: r = self.action <=> other.action
65: r = self.position <=> other.position if r.zero?
66: r = self.element <=> other.element if r.zero?
67: r
68: end
# File lib/diff/lcs/change.rb, line 57
57: def ==(other)
58: (self.action == other.action) and
59: (self.position == other.position) and
60: (self.element == other.element)
61: end
Creates a Change from an array produced by Change#to_a.
# File lib/diff/lcs/change.rb, line 77
77: def to_a
78: [@action, @position, @element]
79: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.