Class: GovukPublishingComponents::Presenters::PotentialSearchActionSchema
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::PotentialSearchActionSchema
- Defined in:
- lib/govuk_publishing_components/presenters/machine_readable/potential_search_action_schema.rb
Constant Summary collapse
- BASE_SEARCH_URL =
"#{Plek.new.website_root}/search/all?keywords={query}&order=relevance".freeze
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#facet_params ⇒ Object
readonly
Returns the value of attribute facet_params.
Instance Method Summary collapse
-
#initialize(facet_params, description) ⇒ PotentialSearchActionSchema
constructor
A new instance of PotentialSearchActionSchema.
- #structured_data ⇒ Object
Constructor Details
#initialize(facet_params, description) ⇒ PotentialSearchActionSchema
Returns a new instance of PotentialSearchActionSchema.
10 11 12 13 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/potential_search_action_schema.rb', line 10 def initialize(facet_params, description) @facet_params = facet_params @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/potential_search_action_schema.rb', line 6 def description @description end |
#facet_params ⇒ Object (readonly)
Returns the value of attribute facet_params.
6 7 8 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/potential_search_action_schema.rb', line 6 def facet_params @facet_params end |
Instance Method Details
#structured_data ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/govuk_publishing_components/presenters/machine_readable/potential_search_action_schema.rb', line 15 def structured_data # http://schema.org/SearchAction - minimal { "potentialAction" => { "@type": "SearchAction", "description": description, "target": search_template, "query": "required", }, } end |