Class: Makiri::Text

Inherits:
Node
  • Object
show all
Defined in:
lib/makiri/text.rb,
ext/makiri/makiri.c

Overview

A text node.

Direct Known Subclasses

HTML::Text, XML::Text

Class Method Summary collapse

Methods inherited from Node

#add_class, #append_class, #at, #attribute, #attribute?, #attributes, #blank?, #cdata?, #classes, #clone, #comment?, #document?, #document_fragment?, #dup, #each, #element?, #inspect, #path, #processing_instruction?, #remove_class, #root, #search, #set_attribute, #text?, #to_h, #traverse

Class Method Details

.new(content, document) ⇒ Makiri::Text

Create a detached text node with content owned by document (Nokogiri-style constructor; delegates to Document#create_text_node).

Parameters:

Returns:



12
13
14
# File 'lib/makiri/text.rb', line 12

def self.new(content, document)
  Makiri::Document.coerce!(document).create_text_node(content)
end