class Asciidoctor::AbstractNode
def attr? name, expected_value = nil, fallback_name = nil
Returns a [Boolean] indicating whether the attribute exists and, if a truthy comparison value is specified, whether
this node (default: same as name).
fallback_name - The String or Symbol of the attribute to resolve on the Document if the attribute is not found on
expected_value - The expected Object value of the attribute (default: nil).
name - The String or Symbol name of the attribute to resolve.
return whether the attribute was found.
if the attribute is found, and the comparison value is truthy, return whether the two values match. Otherwise,
same as name), and this node is not the Document node, look for that attribute on the Document node. In either case,
Look for the specified attribute in the attributes on this node. If not found, fallback_name is specified (default:
comparison with the expected value if specified.
Public: Check if the specified attribute is defined using the same logic as {#attr}, optionally performing a
def attr? name, expected_value = nil, fallback_name = nil if expected_value expected_value == (@attributes[name.to_s] || (fallback_name && @parent ? @document.attributes[(fallback_name == true ? name : fallback_name).to_s] : nil)) else (@attributes.key? name.to_s) || (fallback_name && @parent ? (@document.attributes.key? (fallback_name == true ? name : fallback_name).to_s) : false) end end