Class: Katello::HostSubscriptionPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Katello::HostSubscriptionPresenter
- Defined in:
- app/presenters/katello/host_subscription_presenter.rb
Instance Attribute Summary collapse
-
#quantity_consumed ⇒ Object
Returns the value of attribute quantity_consumed.
Instance Method Summary collapse
-
#initialize(entitlement) ⇒ HostSubscriptionPresenter
constructor
A new instance of HostSubscriptionPresenter.
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_consumed ⇒ Object
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 |