lib/lolita/observed_array.rb in lolita-3.0.7 vs lib/lolita/observed_array.rb in lolita-3.1.0
- old
+ new
@@ -53,9 +53,16 @@
def []=(value,index)
value=build_element(value)
collection_variable[index]=value
end
+
+ #To support enumerable functions as each, collect etc.
+ def each
+ collection_variable.each{|collection_element| yield collection_element}
+ end
+
+
private
def collection_variable
raise "You should implement collection_variable method in your class. See ObservedArray for implementation."
end
\ No newline at end of file