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
- #adding? ⇒ Boolean
- #changed? ⇒ Boolean
- #deleting? ⇒ Boolean
- #finished_a? ⇒ Boolean
- #finished_b? ⇒ Boolean
- #unchanged? ⇒ Boolean
Instance Method Details
#adding? ⇒ Boolean
45 46 47 |
# File 'lib/watobo/external/diff/lcs/change.rb', line 45 def adding? @action == '+' end |
#changed? ⇒ Boolean
53 54 55 |
# File 'lib/watobo/external/diff/lcs/change.rb', line 53 def changed? @changed == '!' end |
#deleting? ⇒ Boolean
41 42 43 |
# File 'lib/watobo/external/diff/lcs/change.rb', line 41 def deleting? @action == '-' end |
#finished_a? ⇒ Boolean
57 58 59 |
# File 'lib/watobo/external/diff/lcs/change.rb', line 57 def finished_a? @changed == '>' end |
#finished_b? ⇒ Boolean
61 62 63 |
# File 'lib/watobo/external/diff/lcs/change.rb', line 61 def finished_b? @changed == '<' end |
#unchanged? ⇒ Boolean
49 50 51 |
# File 'lib/watobo/external/diff/lcs/change.rb', line 49 def unchanged? @action == '=' end |