Class: ContextDev::Models::WebWebScrapeHTMLResponse::Metadata

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/context_dev/models/web_web_scrape_html_response.rb,
sig/context_dev/models/web_web_scrape_html_response.rbs

Overview

See Also:

  • ContextDev::Models::WebWebScrapeHTMLResponse#metadata

Defined Under Namespace

Modules: AdditionalMeta, OpenGraph, Twitter Classes: Alternate

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(href:, hreflang: nil, title: nil, type: nil) ⇒ Object

Parameters:

  • href (String)

    Resolved alternate URL.

  • hreflang (String) (defaults to: nil)

    Language or locale for the alternate URL, when present.

  • title (String) (defaults to: nil)

    Alternate resource title, when present.

  • type (String) (defaults to: nil)

    Alternate resource MIME type, when present.



# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 273

Instance Attribute Details

#additional_metaHash{Symbol=>String, Array<String>}?

Additional non-social meta tags not promoted to top-level metadata fields.

Returns:

  • (Hash{Symbol=>String, Array<String>}, nil)


84
85
86
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 84

optional :additional_meta,
-> { ContextDev::Internal::Type::HashOf[union: ContextDev::Models::WebWebScrapeHTMLResponse::Metadata::AdditionalMeta] },
api_name: :additionalMeta

#alternatesArray<ContextDev::Models::WebWebScrapeHTMLResponse::Metadata::Alternate>?

Resolved alternate links from link rel=alternate tags.



92
93
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 92

optional :alternates,
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebWebScrapeHTMLResponse::Metadata::Alternate] }

#authorString?

Author metadata, when present.

Parameters:

  • (String)

Returns:

  • (String, nil)


99
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 99

optional :author, String

#canonical_urlString?

Resolved canonical URL, when present.

Parameters:

  • (String)

Returns:

  • (String, nil)


105
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 105

optional :canonical_url, String, api_name: :canonicalUrl

#descriptionString?

Best description extracted from standard, Open Graph, or Twitter metadata.

Parameters:

  • (String)

Returns:

  • (String, nil)


111
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 111

optional :description, String

#faviconString?

Resolved favicon URL, when present.

Parameters:

  • (String)

Returns:

  • (String, nil)


117
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 117

optional :favicon, String

#final_urlString

Final URL scraped after redirects or scraper fallback, when known. Falls back to sourceUrl when unavailable.

Parameters:

  • value (String)

Returns:

  • (String)


72
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 72

required :final_url, String, api_name: :finalUrl

#imageString?

Primary resolved preview image from Open Graph, Twitter, or image metadata.

Parameters:

  • (String)

Returns:

  • (String, nil)


123
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 123

optional :image, String

#json_ldArray<Hash{Symbol=>Object}>?

JSON-LD structured data blocks parsed from the page.

Returns:

  • (Array<Hash{Symbol=>Object}>, nil)


129
130
131
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 129

optional :json_ld,
ContextDev::Internal::Type::ArrayOf[ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]],
api_name: :jsonLd

#keywordsArray<String>?

Keywords extracted from the page's keywords meta tag.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


137
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 137

optional :keywords, ContextDev::Internal::Type::ArrayOf[String]

#languageString?

Language extracted from html lang or language meta tags.

Parameters:

  • (String)

Returns:

  • (String, nil)


143
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 143

optional :language, String

#modified_timeString?

Modified timestamp/date from page metadata, when present.

Parameters:

  • (String)

Returns:

  • (String, nil)


149
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 149

optional :modified_time, String, api_name: :modifiedTime

#open_graphHash{Symbol=>String, Array<String>}?

Open Graph metadata with the og: prefix removed and keys camel-cased.

Returns:

  • (Hash{Symbol=>String, Array<String>}, nil)


155
156
157
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 155

optional :open_graph,
-> { ContextDev::Internal::Type::HashOf[union: ContextDev::Models::WebWebScrapeHTMLResponse::Metadata::OpenGraph] },
api_name: :openGraph

#published_timeString?

Published timestamp/date from page metadata, when present.

Parameters:

  • (String)

Returns:

  • (String, nil)


163
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 163

optional :published_time, String, api_name: :publishedTime

#robotsString?

Robots meta directive, when present.

Parameters:

  • (String)

Returns:

  • (String, nil)


169
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 169

optional :robots, String

#site_nameString?

Site or application name from page metadata.

Parameters:

  • (String)

Returns:

  • (String, nil)


175
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 175

optional :site_name, String, api_name: :siteName

#source_urlString

Original URL requested by the caller.

Parameters:

  • value (String)

Returns:

  • (String)


78
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 78

required :source_url, String, api_name: :sourceUrl

#titleString?

Best title extracted from the page.

Parameters:

  • (String)

Returns:

  • (String, nil)


181
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 181

optional :title, String

#twitterHash{Symbol=>String, Array<String>}?

Twitter card metadata with the twitter: prefix removed and keys camel-cased.

Returns:

  • (Hash{Symbol=>String, Array<String>}, nil)


187
188
# File 'lib/context_dev/models/web_web_scrape_html_response.rb', line 187

optional :twitter,
-> { ContextDev::Internal::Type::HashOf[union: ContextDev::Models::WebWebScrapeHTMLResponse::Metadata::Twitter] }

Instance Method Details

#to_hash{

Returns:

  • ({)


176
# File 'sig/context_dev/models/web_web_scrape_html_response.rbs', line 176

def to_hash: -> {