Class: GovukPublishingComponents::Presenters::IsPartOfSchema

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

Instance Method Summary collapse

Constructor Details

#initialize(is_part_of_url) ⇒ IsPartOfSchema

Returns a new instance of IsPartOfSchema.



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

def initialize(is_part_of_url)
  @is_part_of_url = is_part_of_url
end

Instance Method Details

#structured_dataObject



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

def structured_data
  # http://schema.org/isPartOf - minimal
  {
    "@context" => "http://schema.org",
    "@type" => "CreativeWork",
    "sameAs" => @is_part_of_url,
  }
end