Module: Diff::LCS::ChangeTypeTests

Included in:
Change, ContextChange
Defined in:
lib/watobo/external/diff/lcs/change.rb

Overview

Centralises the change test code in Diff::LCS::Change and Diff::LCS::ContextChange, since it’s the same for both classes.

Instance Method Summary collapse

Instance Method Details

#adding?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/watobo/external/diff/lcs/change.rb', line 45

def adding?
  @action == '+'
end

#changed?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/watobo/external/diff/lcs/change.rb', line 53

def changed?
  @changed == '!'
end

#deleting?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/watobo/external/diff/lcs/change.rb', line 41

def deleting?
  @action == '-'
end

#finished_a?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/watobo/external/diff/lcs/change.rb', line 57

def finished_a?
  @changed == '>'
end

#finished_b?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/watobo/external/diff/lcs/change.rb', line 61

def finished_b?
  @changed == '<'
end

#unchanged?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/watobo/external/diff/lcs/change.rb', line 49

def unchanged?
  @action == '='
end