# File lib/asciidoctor/abstract_node.rb, line 111
  def attr? name, expect_val = nil, inherit = true
    name = name.to_s
    # NOTE if @parent is set, it means @document is also set
    if expect_val.nil?
      (@attributes.key? name) || (inherit && @parent && (@document.attributes.key? name))
    else
      expect_val == (@attributes[name] || (inherit && @parent ? @document.attributes[name] : nil))
    end
  end