ext/xml/libxml.rb in libxml-ruby-0.3.8.2 vs ext/xml/libxml.rb in libxml-ruby-0.3.8.4

- old
+ new

@@ -1,28 +1,20 @@ -# $Id: libxml.rb,v 1.5 2006/10/29 19:42:45 roscopeco Exp $ +# $Id: libxml.rb,v 1.5.2.1 2006/11/26 12:37:42 roscopeco Exp $ # Please see the LICENSE file for copyright and distribution information require 'xml/libxml_so' -class XML::Node::Set - def empty? - self.length <= 0 - end - - def first - self.each { |n| return n } - end -end - class XML::Document include Enumerable # maybe, maybe not... def each(&blk) find('//*').each(&blk) end end class XML::Node::Set + include Enumerable + # inefficient, but maybe can find a way to cache the # ary and dump on change? def [](i, count = nil) if count to_a[i,count]