class Asciidoctor::AbstractNode

def add_role name

Returns a [Boolean] indicating whether the role was added.

Public: Adds the given role directly to this node.
def add_role name
  if (val = @attributes['role'])
    # NOTE center + include? is faster than split + include?
    if %( #{val} ).include? %( #{name} )
      false
    else
      @attributes['role'] = %(#{val} #{name})
      true
    end
  else
    @attributes['role'] = name
    true
  end
end