class Asciidoctor::AbstractNode
def attr?(name, expect = nil, inherit = true)
comparison value is specified, whether the value of the attribute matches
return a Boolean indicating whether the attribute exists and, if a
AsciiDoctor::Document if not found on this node (default: false)
inherit - a Boolean indicating whether to check for the attribute on the
expect - the expected Object value of the attribute (default: nil)
name - the String or Symbol name of the attribute to lookup
Otherwise, return whether the attribute was found.
comparison value is specified (not nil), return whether the two values match.
the attributes of the Document node. If the attribute is found and a
node. If not found, and this node is a child of the Document node, look in
Check if the attribute is defined. First look in the attributes on this
comparison of its value if expected is not nil
Public: Check if the attribute is defined, optionally performing a
def attr?(name, expect = nil, inherit = true) name = name.to_s if ::Symbol === name inherit = false if self == @document if expect.nil? @attributes.has_key?(name) || (inherit && @document.attributes.has_key?(name)) elsif inherit expect == (@attributes[name] || @document.attributes[name]) else expect == @attributes[name] end end