Sha256: 69ef38b7a8aa7586c747819bcdba55bebe4802a64130165ecd9231d425efda60
Contents?: true
Size: 651 Bytes
Versions: 5
Compression:
Stored size: 651 Bytes
Contents
#include <xml_text.h> static void dealloc(xmlNodePtr node) { if (node->doc == NULL) { NOKOGIRI_DEBUG_START_TEXT(node); xmlFreeNode(node); NOKOGIRI_DEBUG_END(node); } } static VALUE new(VALUE klass, VALUE string) { xmlNodePtr node = xmlNewText((xmlChar *)StringValuePtr(string)); VALUE rb_node = Data_Wrap_Struct(klass, NULL, dealloc, node); node->_private = (void *)rb_node; if(rb_block_given_p()) rb_yield(rb_node); return rb_node; } VALUE cNokogiriXmlText ; void init_xml_text() { VALUE klass = cNokogiriXmlText = rb_const_get(mNokogiriXml, rb_intern("Text")); rb_define_singleton_method(klass, "new", new, 1); }
Version data entries
5 entries across 5 versions & 2 rubygems