client/hyalite/dom/document.rb in hyalite-0.1.0 vs client/hyalite/dom/document.rb in hyalite-0.1.1

- old
+ new

@@ -26,16 +26,9 @@ def document? true end def [](q) - elements = [] - %x( - var nodeList = self.native.querySelectorAll(#{q}); - for (var i = 0; i < nodeList.length; i++) { - elements.$push(nodeList.item(i)); - } - ) - elements.map!{|el| Element.new(el) } + Collection.new `self.native.querySelectorAll(#{q})` end end end