class GovukPublishingComponents::Presenters::IsPartOfSchema

Public Class Methods

new(is_part_of_url) click to toggle source
# 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

Public Instance Methods

structured_data() click to toggle source
# 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