Sha256: be37696d9ec44e6a7299d7de45af5b3712b7f113f3edeb7e803d30b099412891
Contents?: true
Size: 1.13 KB
Versions: 36
Compression:
Stored size: 1.13 KB
Contents
module GovukPublishingComponents module Presenters class Page attr_reader :local_assigns def initialize(local_assigns) @local_assigns = local_assigns end def schema local_assigns.fetch(:schema) end def canonical_url local_assigns[:canonical_url] || (Plek.current.website_root + content_item["base_path"]) end def body local_assigns[:body] || content_item.dig("details", "body") end def title local_assigns[:title] || content_item["title"] end def description local_assigns[:description] || content_item["description"] end def has_image? content_item.dig("details", "image").present? end def image_url content_item.dig("details", "image", "url") end def image_alt_text content_item.dig("details", "image", "alt_text") end def image_placeholders local_assigns[:image_placeholders] end def content_item local_assigns[:content_item] end def logo_url local_assigns[:logo_url] end end end end
Version data entries
36 entries across 36 versions & 1 rubygems