Class: GovukPublishingComponents::Presenters::SearchResultsPageSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk_publishing_components/presenters/machine_readable/search_results_page_schema.rb

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ SearchResultsPageSchema

Returns a new instance of SearchResultsPageSchema.



4
5
6
# File 'lib/govuk_publishing_components/presenters/machine_readable/search_results_page_schema.rb', line 4

def initialize(page)
  @page = page
end

Instance Method Details

#structured_dataObject



8
9
10
11
12
13
# File 'lib/govuk_publishing_components/presenters/machine_readable/search_results_page_schema.rb', line 8

def structured_data
  # http://schema.org/SearchResultsPage
  data = CreativeWorkSchema.new(@page).structured_data
  data["@type"] = "SearchResultsPage"
  data
end