Class: Kreuzberg::LinkMetadata

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

Overview

Link metadata

Represents a link element found in the HTML document

Examples:

link = Kreuzberg::LinkMetadata.new(
  href: "https://example.com",
  text: "Example",
  title: "Example Site",
  link_type: "external",
  rel: ["noopener", "noreferrer"],
  attributes: { "data-id" => "123" }
)
puts "#{link.text} -> #{link.href}"