Class: Kreuzberg::HeaderMetadata

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/kreuzberg/types.rb

Overview

Header/Heading metadata

Represents a heading element found in the HTML document

Examples:

header = Kreuzberg::HeaderMetadata.new(
  level: 1,
  text: "Main Title",
  id: "main-title",
  depth: 0,
  html_offset: 245
)
puts "#{header.text} (H#{header.level})"