Class: GovukPublishingComponents::Presenters::SearchResultsPageSchema
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::SearchResultsPageSchema
- Defined in:
- lib/govuk_publishing_components/presenters/machine_readable/search_results_page_schema.rb
Instance Method Summary collapse
-
#initialize(page) ⇒ SearchResultsPageSchema
constructor
A new instance of SearchResultsPageSchema.
- #structured_data ⇒ Object
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_data ⇒ Object
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 |