Sha256: ab28f145b7a121bd440ad25e99713c2aa88696295758b854ae6e3e8dac4de55c
Contents?: true
Size: 814 Bytes
Versions: 101
Compression:
Stored size: 814 Bytes
Contents
require 'plek' module GovukPublishingComponents module Presenters class PotentialSearchActionSchema attr_reader :facet_params, :description BASE_SEARCH_URL = "#{Plek.current.website_root}/search/all?keywords={query}&order=relevance".freeze def initialize(facet_params, description) @facet_params = facet_params @description = description end def structured_data # http://schema.org/SearchAction - minimal { "potentialAction" => { "@type": "SearchAction", "description": description, "target": search_template, "query": "required" } } end private def search_template "#{BASE_SEARCH_URL}&#{facet_params.to_query}" end end end end
Version data entries
101 entries across 101 versions & 1 rubygems