Class: GovukPublishingComponents::Presenters::NewsArticleSchema
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::NewsArticleSchema
- Defined in:
- lib/govuk_publishing_components/presenters/machine_readable/news_article_schema.rb
Instance Method Summary collapse
-
#initialize(page) ⇒ NewsArticleSchema
constructor
A new instance of NewsArticleSchema.
- #structured_data ⇒ Object
Constructor Details
#initialize(page) ⇒ NewsArticleSchema
Returns a new instance of NewsArticleSchema.
4 5 6 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/news_article_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/news_article_schema.rb', line 8 def structured_data # http://schema.org/NewsArticle data = ArticleSchema.new(@page).structured_data data["@type"] = "NewsArticle" data end |