Class: GovukPublishingComponents::Presenters::HasPartSchema
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::HasPartSchema
- Defined in:
- lib/govuk_publishing_components/presenters/machine_readable/has_part_schema.rb
Instance Attribute Summary collapse
-
#has_part_url ⇒ Object
readonly
Returns the value of attribute has_part_url.
Instance Method Summary collapse
-
#initialize(has_part_url) ⇒ HasPartSchema
constructor
A new instance of HasPartSchema.
- #structured_data ⇒ Object
Constructor Details
#initialize(has_part_url) ⇒ HasPartSchema
Returns a new instance of HasPartSchema.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/has_part_schema.rb', line 6 def initialize(has_part_url) @has_part_url = has_part_url end |
Instance Attribute Details
#has_part_url ⇒ Object (readonly)
Returns the value of attribute has_part_url.
4 5 6 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/has_part_schema.rb', line 4 def has_part_url @has_part_url end |
Instance Method Details
#structured_data ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/has_part_schema.rb', line 10 def structured_data # http://schema.org/hasPart - minimal { "@context" => "http://schema.org", "@type" => "CreativeWork", "sameAs" => has_part_url, } end |