class Asciidoctor::AttributeList

Public: Handles parsing AsciiDoc attribute lists into a Hash of key/value pairs. By default, attributes must each be separated by a comma and quotes may be used around the value. If a key is not detected, the value is assigned to a 1-based positional key, The positional attributes can be “rekeyed” when given a positional_attrs array either during parsing or after the fact.

Examples

attrlist = Asciidoctor::AttributeList.new('astyle')

attrlist.parse
=> { 0 => 'astyle' }

attrlist.rekey(['style'])
=> { 'style' => 'astyle' }

attrlist = Asciidoctor::AttributeList.new('quote, Famous Person, Famous Book (2001)')

attrlist.parse(['style', 'attribution', 'citetitle'])
=> { 'style' => 'quote', 'attribution' => 'Famous Person', 'citetitle' => 'Famous Book (2001)' }