Class: Makiri::Element
- Defined in:
- lib/makiri/element.rb,
ext/makiri/makiri.c
Overview
An element node (HTML or XML). Attribute access lives in C.
Direct Known Subclasses
Class Method Summary collapse
-
.new(name, document) ⇒ Makiri::Element
Create a detached element named
nameowned bydocument(Nokogiri-style constructor; delegates to Document#create_element, so its representation follows the document).
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(name, document) ⇒ Makiri::Element
Create a detached element named name owned by document (Nokogiri-style constructor; delegates to Document#create_element, so its representation follows the document). Attach it with Node#add_child and friends.
13 14 15 |
# File 'lib/makiri/element.rb', line 13 def self.new(name, document) Makiri::Document.coerce!(document).create_element(name) end |