Class: LedgerSync::ResourceAttribute::Reference::Many::ManyArray
- Inherits:
-
Object
- Object
- LedgerSync::ResourceAttribute::Reference::Many::ManyArray
- Includes:
- ActiveModel::Dirty
- Defined in:
- lib/ledger_sync/resource_attribute/reference/many.rb
Constant Summary collapse
- ARRAY_METHODS_TO_OVERRIDE_WITH_DIRTY =
%w[<< | []= + -].freeze
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize ⇒ ManyArray
constructor
A new instance of ManyArray.
- #save ⇒ Object
- #sorted_fingerprints ⇒ Object
Constructor Details
#initialize ⇒ ManyArray
Returns a new instance of ManyArray.
25 26 27 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 25 def initialize @value = [] end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
21 22 23 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 21 def value @value end |
Instance Method Details
#==(other) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 36 def ==(other) return false unless other.is_a?(ManyArray) return false unless other.sorted_fingerprints == sorted_fingerprints true end |
#save ⇒ Object
43 44 45 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 43 def save changes_applied end |
#sorted_fingerprints ⇒ Object
47 48 49 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 47 def sorted_fingerprints value.map(&:fingerprint).sort end |