Method: Amber::Render::TocItem#initialize
- Defined in:
- lib/amber/render/table_of_contents.rb
#initialize(heading = 'h0', text = nil, anchor = nil) ⇒ TocItem
Returns a new instance of TocItem.
204 205 206 207 208 209 |
# File 'lib/amber/render/table_of_contents.rb', line 204 def initialize(heading='h0', text=nil, anchor=nil) @level = heading[1].to_i if heading.is_a?(String) @text = text @anchor = anchor @children = [] end |