Sha256: 5b74ab457350634b9d6eceedf75eab4aef9f79349ca6ff9ac6d197ed6763b528
Contents?: true
Size: 618 Bytes
Versions: 102
Compression:
Stored size: 618 Bytes
Contents
module Katello class HostSubscriptionsPresenter attr_reader :subscriptions def initialize(host) pools = host.subscription_facet&.pools || [] @pools = pools.group_by(&:cp_id) entitlements = host.subscription_facet.candlepin_consumer.entitlements if @pools.any? entitlements ||= [] @subscriptions = entitlements.map do |e| HostSubscriptionPresenter.new(pool: pool_for_entitlement(e), entitlement: e) end end private def pool_for_entitlement(entitlement) pool_cp_id = entitlement['pool']['id'] @pools[pool_cp_id]&.first end end end
Version data entries
102 entries across 102 versions & 1 rubygems