Sha256: c6bb481e97275d680f09b63c307cab87c4e54daad95a596cde950137c552a87d

Contents?: true

Size: 873 Bytes

Versions: 111

Compression:

Stored size: 873 Bytes

Contents

module Katello
  class ProductContentPresenter < SimpleDelegator
    attr_accessor :product_content, :overrides

    def initialize(product_content, overrides)
      @product_content = product_content
      @overrides = overrides
      super(@product_content)
    end

    def override
      override = overrides.find { |pc| pc.content_label == content.label && pc.name == "enabled" }
      override.nil? ? 'default' : override.value
    end

    def enabled_content_override
      overrides.find { |pc| pc.content_label == content.label && pc.name == "enabled" }
    end

    def content_overrides
      overrides.select { |pc| pc.content_label == content.label }
    end

    def legacy_content_override
      override = @overrides.find { |pc| pc.content_label == content.label && pc.name == "enabled" }
      override.nil? ? 'default' : override.value
    end
  end
end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
katello-3.15.3 app/presenters/katello/product_content_presenter.rb
katello-3.16.0.rc4 app/presenters/katello/product_content_presenter.rb
katello-3.16.0.rc3.1 app/presenters/katello/product_content_presenter.rb
katello-3.15.2 app/presenters/katello/product_content_presenter.rb
katello-3.16.0.rc3 app/presenters/katello/product_content_presenter.rb
katello-3.16.0.rc2.1 app/presenters/katello/product_content_presenter.rb
katello-3.16.0.rc2 app/presenters/katello/product_content_presenter.rb
katello-3.15.1.1 app/presenters/katello/product_content_presenter.rb
katello-3.16.0.rc1.1 app/presenters/katello/product_content_presenter.rb
katello-3.15.1 app/presenters/katello/product_content_presenter.rb
katello-3.16.0.rc1 app/presenters/katello/product_content_presenter.rb
katello-3.15.0.1 app/presenters/katello/product_content_presenter.rb
katello-3.15.0 app/presenters/katello/product_content_presenter.rb
katello-3.15.0.rc2 app/presenters/katello/product_content_presenter.rb
katello-3.15.0.rc1.3 app/presenters/katello/product_content_presenter.rb
katello-3.15.0.rc1.2 app/presenters/katello/product_content_presenter.rb
katello-3.15.0.rc1.1 app/presenters/katello/product_content_presenter.rb
katello-3.15.0.rc1 app/presenters/katello/product_content_presenter.rb
katello-3.14.1 app/presenters/katello/product_content_presenter.rb
katello-3.13.4 app/presenters/katello/product_content_presenter.rb