Module: Diff::LCS::ChangeTypeTests

Included in:
Change, ContextChange
Defined in:
lib/gems/diff-lcs-1.1.2/lib/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)


24
25
26
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 24

def adding?
  @action == '+'
end

#changed?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 32

def changed?
  @changed == '!'
end

#deleting?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 20

def deleting?
  @action == '-'
end

#finished_a?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 36

def finished_a?
  @changed == '>'
end

#finished_b?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 40

def finished_b?
  @changed == '<'
end

#unchanged?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 28

def unchanged?
  @action == '='
end