Class: GovukPublishingComponents::Presenters::OrganisationSchema
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::OrganisationSchema
- Defined in:
- lib/govuk_publishing_components/presenters/machine_readable/organisation_schema.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
-
#initialize(page) ⇒ OrganisationSchema
constructor
A new instance of OrganisationSchema.
- #structured_data ⇒ Object
Constructor Details
#initialize(page) ⇒ OrganisationSchema
Returns a new instance of OrganisationSchema.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/organisation_schema.rb', line 6 def initialize(page) @page = page end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
4 5 6 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/organisation_schema.rb', line 4 def page @page end |
Instance Method Details
#structured_data ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/organisation_schema.rb', line 10 def structured_data # http://schema.org/GovernmentOrganization { "@context" => "http://schema.org", "@type" => "GovernmentOrganization", "mainEntityOfPage" => { "@type" => "WebPage", "@id" => page.canonical_url, }, "name" => page.title, "description" => page.description || page.body, } .merge(govuk_logo) .merge(members) .merge(parent_organisations) .merge(sub_organisations) .merge(search_action) end |