class Rote::Filters::TOC::Heading

An individual Heading in the links array.

Attributes

attrs[RW]

The information held by this link

tag[RW]

The information held by this link

title[RW]

The information held by this link

Public Class Methods

new(tag, title, attrs = {}) click to toggle source
# File lib/rote/filters/toc.rb, line 29
def initialize(tag, title, attrs = {})
  @tag = tag
  @title = title   
  @attrs = attrs               
end

Public Instance Methods

anchor() click to toggle source
# File lib/rote/filters/toc.rb, line 38
def anchor
  title.downcase.gsub(/<[^>]+>/,'').gsub(/[^a-z]+/,'_')
end
to_s() click to toggle source
# File lib/rote/filters/toc.rb, line 42
def to_s
  %Q[<a #{"#{(attrs.collect { |k,v| "#{k}='#{v}'" }).join(' ')} " unless attrs.empty?}href='##{anchor}'>#{title}</a>]        
end