Sha256: 690e1240ff3cbf1a3b3d1576025b36813c060761b2eccc5af2ac6a640fa8b902

Contents?: true

Size: 540 Bytes

Versions: 9

Compression:

Stored size: 540 Bytes

Contents

module GovukPublishingComponents
  module Presenters
    class TranslationNavHelper
      attr_reader :translations

      def initialize(local_assigns)
        @translations = []
        @translations = local_assigns[:translations] if local_assigns[:translations]
      end

      def has_translations?
        true if @translations.length > 1
      end

      def tracking_is_present?
        @translations.each do |translation|
          return true if translation[:data_attributes]
        end
        false
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
govuk_publishing_components-9.2.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-9.1.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-9.1.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-9.0.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-9.0.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-8.2.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-8.1.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-8.0.1 lib/govuk_publishing_components/presenters/translation_nav_helper.rb
govuk_publishing_components-8.0.0 lib/govuk_publishing_components/presenters/translation_nav_helper.rb