Class: Mdtoc::Markdown::HeaderWithFragment

Inherits:
Header
  • Object
show all
Defined in:
lib/mdtoc/markdown/header.rb

Instance Attribute Summary

Attributes inherited from Header

#depth

Instance Method Summary collapse

Methods inherited from Header

#to_s, #top_level?

Constructor Details

#initialize(depth, label, url, generator:) ⇒ HeaderWithFragment

Returns a new instance of HeaderWithFragment.



52
53
54
55
# File 'lib/mdtoc/markdown/header.rb', line 52

def initialize(depth, label, url, generator:)
  super(depth, label, url)
  @url += "##{generator.generate(@label)}"
end