An individual Heading in the links array.
Methods
Attributes
| [RW] | attrs | The information held by this link |
| [RW] | tag | The information held by this link |
| [RW] | title | The information held by this link |
Public Class methods
[ show source ]
# File lib/rote/filters/toc.rb, line 29
29: def initialize(tag, title, attrs = {})
30: @tag = tag
31: @title = title
32: @attrs = attrs
33: end
Public Instance methods
[ show source ]
# File lib/rote/filters/toc.rb, line 38
38: def anchor
39: title.downcase.gsub(/<[^>]+>/,'').gsub(/[^a-z]+/,'_')
40: end
[ show source ]
# File lib/rote/filters/toc.rb, line 42
42: def to_s
43: %Q[<a #{"#{(attrs.collect { |k,v| "#{k}='#{v}'" }).join(' ')} " unless attrs.empty?}href='##{anchor}'>#{title}</a>]
44: end