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.
135 136 137 |
# File 'lib/yoda/store/objects/merger.rb', line 135 def initialize(els) @array = els.dup end |
Instance Attribute Details
#array ⇒ Array<Object> (readonly)
130 131 132 |
# File 'lib/yoda/store/objects/merger.rb', line 130 def array @array end |
Class Method Details
.append(els, *others) ⇒ Object
121 122 123 124 125 126 127 |
# File 'lib/yoda/store/objects/merger.rb', line 121 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
140 141 142 143 |
# File 'lib/yoda/store/objects/merger.rb', line 140 def append(els) array.push(*els) self end |