Class: Katello::HostSubscriptionPresenter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entitlement) ⇒ HostSubscriptionPresenter

Returns a new instance of HostSubscriptionPresenter.



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

def initialize(entitlement)
  @subscription = Katello::Pool.find_by(:cp_id => entitlement['pool']['id'])
  @quantity_consumed = entitlement.try(:[], :quantity)
  super(@subscription)
end

Instance Attribute Details

#quantity_consumedObject

Returns the value of attribute quantity_consumed.



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

def quantity_consumed
  @quantity_consumed
end