Class: Makiri::Attr
- Defined in:
- lib/makiri/attr.rb,
ext/makiri/makiri.c
Overview
An attribute node. Most of the API lives in C (#name, #value).
An attribute knows its owning element through the document’s lazily-built attr->owner index, exposed as both #parent and #element.
Direct Known Subclasses
Instance Method Summary collapse
-
#element ⇒ Makiri::Element?
The element this attribute belongs to, or nil if detached.
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
Instance Method Details
#element ⇒ Makiri::Element?
The element this attribute belongs to, or nil if detached. Defined as a method (not an alias) so it resolves #parent dynamically on the per-kind leaf, where the reader actually lives.
13 14 15 |
# File 'lib/makiri/attr.rb', line 13 def element parent end |