Module: Diff::LCS::ChangeTypeTests
- Included in:
- Change, ContextChange
- Defined in:
- 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)
- - (Boolean) adding?
- - (Boolean) changed?
- - (Boolean) deleting?
- - (Boolean) finished_a?
- - (Boolean) finished_b?
- - (Boolean) unchanged?
Instance Method Details
- (Boolean) adding?
16 17 18 |
# File 'lib/diff/lcs/change.rb', line 16 def adding? @action == '+' end |
- (Boolean) changed?
24 25 26 |
# File 'lib/diff/lcs/change.rb', line 24 def changed? @changed == '!' end |
- (Boolean) deleting?
12 13 14 |
# File 'lib/diff/lcs/change.rb', line 12 def deleting? @action == '-' end |
- (Boolean) finished_a?
28 29 30 |
# File 'lib/diff/lcs/change.rb', line 28 def finished_a? @changed == '>' end |
- (Boolean) finished_b?
32 33 34 |
# File 'lib/diff/lcs/change.rb', line 32 def finished_b? @changed == '<' end |
- (Boolean) unchanged?
20 21 22 |
# File 'lib/diff/lcs/change.rb', line 20 def unchanged? @action == '=' end |