class HTMLStartTagComment
Represents an HTML start tag in a documentation comment.
Definitions
def self_closing?
Check if this is a self-closing tag.
Signature
-
returns
Boolean True if the tag is self-closing (e.g.,
).
Implementation
def self_closing?
Lib.html_start_tag_comment_is_self_closing(@comment) != 0
end
def num_attrs
Get the number of attributes on this tag.
Signature
-
returns
Integer The number of attributes.
Implementation
def num_attrs
Lib.html_start_tag_comment_get_num_attrs(@comment)
end
def attrs
Get all attributes on this tag.
Signature
-
returns
Array<Hash> An array of hashes with :name and :value keys.
Implementation
def attrs
num_attrs.times.map {|i|
{
name: Lib.extract_string(Lib.html_start_tag_comment_get_attr_name(@comment, i)),
value: Lib.extract_string(Lib.html_start_tag_comment_get_attr_value(@comment, i)),
}
}
end