lib/glimmer/data_binding/observable_array.rb in glimmer-1.0.1 vs lib/glimmer/data_binding/observable_array.rb in glimmer-1.0.2
- old
+ new
@@ -107,10 +107,11 @@
add_element_observers(element)
notify_observers
end
end
alias push <<
+ alias append <<
def []=(index, value)
old_value = self[index]
unregister_dependent_observers(old_value)
remove_element_observers(old_value)
@@ -258,9 +259,17 @@
(block.nil? ? super() : super(&block)).tap do
each { |element| add_element_observers(element) }
notify_observers
end
end
+
+ def unshift(element)
+ super(element).tap do
+ add_element_observers(element)
+ notify_observers
+ end
+ end
+ alias prepend unshift
def reject!(&block)
if block.nil?
super
else