Class: Kreuzberg::StructuredData

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

Overview

Structured data metadata

Represents structured data (JSON-LD, microdata, etc.) found in the HTML document

Examples:

structured = Kreuzberg::StructuredData.new(
  data_type: "json-ld",
  raw_json: '{"@context":"https://schema.org","@type":"Article",...}',
  schema_type: "Article"
)
data = JSON.parse(structured.raw_json)
puts data['@type']