Parent

Included Modules

Diff::LCS::Change

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

Attributes

action[R]

Returns the action this Change represents. Can be ’+’ (#), ’-’ (#), ’=’ (#), # or ’!’ (#). When created by Diff::LCS#diff or Diff::LCS#sdiff, it may also be ’>’ (#) or ’<’ (#).

position[R]
element[R]

Public Class Methods

from_a(arr) click to toggle source
    # File lib/diff/lcs/change.rb, line 81
81:   def self.from_a(arr)
82:     Diff::LCS::Change.new(arr[0], arr[1], arr[2])
83:   end
new(action, position, element) click to toggle source
    # File lib/diff/lcs/change.rb, line 70
70:   def initialize(action, position, element)
71:     @action = action
72:     @position = position
73:     @element = element
74:   end

Public Instance Methods

<=>(other) click to toggle source
    # 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
==(other) click to toggle source
    # 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
to_a() click to toggle source

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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.