Class: Dotsync::Diff
- Inherits:
-
Object
- Object
- Dotsync::Diff
- Defined in:
- lib/dotsync/models/diff.rb
Overview
Represents the differences between two directories
Instance Attribute Summary collapse
-
#additions ⇒ Object
readonly
Returns the value of attribute additions.
-
#modifications ⇒ Object
readonly
Returns the value of attribute modifications.
-
#removals ⇒ Object
readonly
Returns the value of attribute removals.
Instance Method Summary collapse
- #any? ⇒ Boolean
- #empty? ⇒ Boolean
-
#initialize(additions: [], modifications: [], removals: []) ⇒ Diff
constructor
A new instance of Diff.
Constructor Details
#initialize(additions: [], modifications: [], removals: []) ⇒ Diff
Returns a new instance of Diff.
8 9 10 11 12 |
# File 'lib/dotsync/models/diff.rb', line 8 def initialize(additions: [], modifications: [], removals: []) @additions = additions @modifications = modifications @removals = removals end |
Instance Attribute Details
#additions ⇒ Object (readonly)
Returns the value of attribute additions.
6 7 8 |
# File 'lib/dotsync/models/diff.rb', line 6 def additions @additions end |
#modifications ⇒ Object (readonly)
Returns the value of attribute modifications.
6 7 8 |
# File 'lib/dotsync/models/diff.rb', line 6 def modifications @modifications end |
#removals ⇒ Object (readonly)
Returns the value of attribute removals.
6 7 8 |
# File 'lib/dotsync/models/diff.rb', line 6 def removals @removals end |
Instance Method Details
#any? ⇒ Boolean
14 15 16 |
# File 'lib/dotsync/models/diff.rb', line 14 def any? @additions.any? || @modifications.any? || @removals.any? end |
#empty? ⇒ Boolean
18 19 20 |
# File 'lib/dotsync/models/diff.rb', line 18 def empty? @additions.empty? && @modifications.empty? && @removals.empty? end |