use of nokogiri.internals.NokogiriHelpers.nodeArrayToRubyArray in project nokogiri by sparklemotion.
the class XmlNode method element_children.
@JRubyMethod(name = { "element_children", "elements" })
public IRubyObject element_children(ThreadContext context) {
List<Node> elementNodes = new ArrayList<Node>();
addElements(node, elementNodes, false);
if (elementNodes.size() == 0)
return XmlNodeSet.newEmptyNodeSet(context);
RubyArray array = NokogiriHelpers.nodeArrayToRubyArray(context.getRuntime(), elementNodes.toArray(new Node[0]));
XmlNodeSet xmlNodeSet = XmlNodeSet.newXmlNodeSet(context, array);
return xmlNodeSet;
}
use of nokogiri.internals.NokogiriHelpers.nodeArrayToRubyArray in project gocd by gocd.
the class XmlNode method element_children.
@JRubyMethod(name = { "element_children", "elements" })
public IRubyObject element_children(ThreadContext context) {
List<Node> elementNodes = new ArrayList<Node>();
addElements(node, elementNodes, false);
if (elementNodes.size() == 0)
return XmlNodeSet.newEmptyNodeSet(context);
RubyArray array = NokogiriHelpers.nodeArrayToRubyArray(context.getRuntime(), elementNodes.toArray(new Node[0]));
XmlNodeSet xmlNodeSet = XmlNodeSet.newXmlNodeSet(context, array);
return xmlNodeSet;
}
Aggregations