Class: Yoda::Store::Objects::Merger::PendingArray
- Inherits:
-
Object
- Object
- Yoda::Store::Objects::Merger::PendingArray
- Extended by:
- Forwardable
- Defined in:
- lib/yoda/store/objects/merger.rb
Instance Attribute Summary collapse
- #array ⇒ Array<Object> readonly
Class Method Summary collapse
Instance Method Summary collapse
- #append(els) ⇒ Object
-
#initialize(els) ⇒ PendingArray
constructor
A new instance of PendingArray.
Constructor Details
#initialize(els) ⇒ PendingArray
Returns a new instance of PendingArray.
134 135 136 |
# File 'lib/yoda/store/objects/merger.rb', line 134 def initialize(els) @array = els.dup end |
Instance Attribute Details
#array ⇒ Array<Object> (readonly)
129 130 131 |
# File 'lib/yoda/store/objects/merger.rb', line 129 def array @array end |
Class Method Details
.append(els, *others) ⇒ Object
120 121 122 123 124 125 126 |
# File 'lib/yoda/store/objects/merger.rb', line 120 def self.append(els, *others) if els.is_a?(PendingArray) others.reduce(els) { |array, item| array.append(item) } else append(PendingArray.new(els), *others) end end |
Instance Method Details
#append(els) ⇒ Object
139 140 141 142 |
# File 'lib/yoda/store/objects/merger.rb', line 139 def append(els) array.push(*els) self end |