private IRubyObject fromObjectToRuby(Object o) {
// argument object type is one of NodeList, String, Boolean, or Double.
Ruby runtime = this.handler.getRuntime();
if (o instanceof NodeList) {
XmlNodeSet xmlNodeSet = (XmlNodeSet)NokogiriService.XML_NODESET_ALLOCATOR.allocate(runtime, getNokogiriClass(runtime, "Nokogiri::XML::NodeSet"));
xmlNodeSet.setNodeList((NodeList) o);
return xmlNodeSet;
} else {
return JavaUtil.convertJavaToUsableRubyObject(runtime, o);
}
}