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
- #adding? ⇒ Boolean
- #changed? ⇒ Boolean
- #deleting? ⇒ Boolean
- #finished_a? ⇒ Boolean
- #finished_b? ⇒ Boolean
- #unchanged? ⇒ Boolean
Instance Method Details
#adding? ⇒ 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
32 33 34 |
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 32 def changed? @changed == '!' end |
#deleting? ⇒ 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
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
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
28 29 30 |
# File 'lib/gems/diff-lcs-1.1.2/lib/diff/lcs/change.rb', line 28 def unchanged? @action == '=' end |