Class: Katello::ActivationKeySubscriptionsPresenter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pool, key_pools) ⇒ ActivationKeySubscriptionsPresenter

Returns a new instance of ActivationKeySubscriptionsPresenter.



5
6
7
8
# File 'app/presenters/katello/activation_key_subscriptions_presenter.rb', line 5

def initialize(pool, key_pools)
  @quantity_attached = key_pools.find { |sub| sub['id'] == pool.cp_id }.try(:[], :amount)
  super(pool)
end

Instance Attribute Details

#quantity_attachedObject (readonly)

Returns the value of attribute quantity_attached.



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

def quantity_attached
  @quantity_attached
end