Sha256: ce803a62de978d144bc3929f27dee38968e5d506f73d08d3724dc589239cbd8a

Contents?: true

Size: 702 Bytes

Versions: 10

Compression:

Stored size: 702 Bytes

Contents

module Katello
  class ProductContentPresenter
    attr_accessor :product_content, :overrides
    delegate :content, :enabled, :product, :to => :product_content

    def initialize(product_content, overrides)
      @product_content = product_content
      @overrides = overrides
    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
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
katello-3.5.0.rc1 app/presenters/katello/product_content_presenter.rb
katello-3.4.5 app/presenters/katello/product_content_presenter.rb
katello-3.4.4 app/presenters/katello/product_content_presenter.rb
katello-3.4.2 app/presenters/katello/product_content_presenter.rb
katello-3.4.1 app/presenters/katello/product_content_presenter.rb
katello-3.4.0.2 app/presenters/katello/product_content_presenter.rb
katello-3.4.0.1 app/presenters/katello/product_content_presenter.rb
katello-3.4.0 app/presenters/katello/product_content_presenter.rb
katello-3.4.0.rc2 app/presenters/katello/product_content_presenter.rb
katello-3.4.0.rc1 app/presenters/katello/product_content_presenter.rb