Class: Katello::ProductContentPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/katello/product_content_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product_content, overrides) ⇒ ProductContentPresenter

Returns a new instance of ProductContentPresenter.



6
7
8
9
# File 'app/presenters/katello/product_content_presenter.rb', line 6

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

Instance Attribute Details

#overridesObject

Returns the value of attribute overrides.



3
4
5
# File 'app/presenters/katello/product_content_presenter.rb', line 3

def overrides
  @overrides
end

#product_contentObject

Returns the value of attribute product_content.



3
4
5
# File 'app/presenters/katello/product_content_presenter.rb', line 3

def product_content
  @product_content
end

Instance Method Details

#enabled_overrideObject



11
12
13
14
# File 'app/presenters/katello/product_content_presenter.rb', line 11

def enabled_override
  override = overrides.find { |pc| pc[:contentLabel] == content.label }
  override.nil? ? 'default' : override[:value]
end