class Layer::Patch::Array

Public Instance Methods

<<(value) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 16
def <<(value)
  patch.add(value)
  super
end
Also aliased as: push
[]=(index, value) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 11
def []=(index, value)
  patch.add_index(index, value)
  super
end
clear() click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 37
def clear
  patch.replace([])
  super
end
concat(values) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 27
def concat(values)
  values.each { |value| patch.add(value) }
  super
end
delete(value) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 47
def delete(value)
  patch.remove(value)
  super
end
delete_at(index) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 42
def delete_at(index)
  patch.remove_index(index)
  super
end
insert(offset, values) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 32
def insert(offset, values)
  values.each_with_index { |value, index| patch.add_index(offset + index, value) }
  super
end
pop() click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 52
def pop
  patch.remove_index(length)
  super
end
prepare_base(base) click to toggle source
# File lib/layer/patch/array.rb, line 5
def prepare_base(base)
  base.each_with_index.map do |(value, index)|
    wrap(index, value)
  end
end
push(value)
Alias for: <<
replace(values) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 62
def replace(values)
  patch.replace(values)
  super
end
shift() click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 57
def shift
  patch.remove_index(0)
  super
end
unshift(value) click to toggle source
Calls superclass method
# File lib/layer/patch/array.rb, line 22
def unshift(value)
  patch.add_index(0, value)
  super
end