Class: Cumulus::Common::ListChange
- Inherits:
-
Struct
- Object
- Struct
- Cumulus::Common::ListChange
- Defined in:
- lib/common/models/ListChange.rb
Instance Attribute Summary collapse
-
#added ⇒ Object
Returns the value of attribute added.
-
#modified ⇒ Object
Returns the value of attribute modified.
-
#removed ⇒ Object
Returns the value of attribute removed.
Class Method Summary collapse
-
.simple_list_diff(aws, local) ⇒ Object
Public: Creates a ListChange from aws and local arrays with simple types where the ListChange only has added and removed.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Public: Returns true if all of added, removed, and modified are either nil or empty.
Instance Attribute Details
#added ⇒ Object
Returns the value of attribute added
3 4 5 |
# File 'lib/common/models/ListChange.rb', line 3 def added @added end |
#modified ⇒ Object
Returns the value of attribute modified
3 4 5 |
# File 'lib/common/models/ListChange.rb', line 3 def modified @modified end |
#removed ⇒ Object
Returns the value of attribute removed
3 4 5 |
# File 'lib/common/models/ListChange.rb', line 3 def removed @removed end |
Class Method Details
.simple_list_diff(aws, local) ⇒ Object
Public: Creates a ListChange from aws and local arrays with simple types where the ListChange only has added and removed
6 7 8 9 10 11 12 13 |
# File 'lib/common/models/ListChange.rb', line 6 def self.simple_list_diff(aws, local) added = local - aws removed = aws - local if !added.empty? or !removed.empty? ListChange.new(added, removed, nil) end end |
Instance Method Details
#empty? ⇒ Boolean
Public: Returns true if all of added, removed, and modified are either nil or empty
16 17 18 |
# File 'lib/common/models/ListChange.rb', line 16 def empty? (self.added.nil? or self.added.empty?) and (self.removed.nil? or self.removed.empty?) and (self.modified.nil? or self.modified.empty?) end |