Method: Nokogiri::XML::NodeSet#push

Defined in:
ext/nokogiri/xml_node_set.c

#push(node) ⇒ Object Also known as: <<

Append node to the NodeSet.

[View source] [View on GitHub]

157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'ext/nokogiri/xml_node_set.c', line 157

static VALUE
push(VALUE rb_self, VALUE rb_node)
{
  xmlNodeSetPtr c_self;
  xmlNodePtr node;

  Check_Node_Set_Node_Type(rb_node);

  TypedData_Get_Struct(rb_self, xmlNodeSet, &xml_node_set_type, c_self);
  Noko_Node_Get_Struct(rb_node, xmlNode, node);

  xmlXPathNodeSetAdd(c_self, node);

  return rb_self;
}