class Moxml::NodeSet
def +(other)
def +(other) self.class.new(nodes + other.nodes, context) end
def [](index)
def [](index) case index when Integer Node.wrap(nodes[index], context) when Range NodeSet.new(nodes[index], context) end end
def each
def each return to_enum(:each) unless block_given? nodes.each { |node| yield Node.wrap(node, context) } self end
def empty?
def empty? nodes.empty? end
def first
def first Node.wrap(nodes.first, context) end
def initialize(nodes, context)
def initialize(nodes, context) @nodes = Array(nodes) @context = context end
def last
def last Node.wrap(nodes.last, context) end
def remove
def remove each(&:remove) self end
def size
def size nodes.size end
def text
def text map(&:text).join end
def to_a
def to_a map { |node| node } end