Sha256: ef14f8182ead05c7c7dc81b27c675117dfb904a45ce98ecf0e848fdef0341485

Contents?: true

Size: 844 Bytes

Versions: 2

Compression:

Stored size: 844 Bytes

Contents

require 'singleton'

class Chef
  class Platform
    class ResourcePriorityMap
      include Singleton

      def get_priority_array(node, resource_name, canonical: nil)
        priority_map.get(node, resource_name.to_sym, canonical: canonical)
      end

      def set_priority_array(resource_name, priority_array, *filter, &block)
        priority_map.set(resource_name.to_sym, Array(priority_array), *filter, &block)
      end

      # @api private
      def delete_canonical(resource_name, resource_class)
        priority_map.delete_canonical(resource_name, resource_class)
      end

      # @api private
      def list_handlers(*args)
        priority_map.list(*args).flatten(1).uniq
      end

      private

      def priority_map
        require 'chef/node_map'
        @priority_map ||= Chef::NodeMap.new
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-12.4.0.rc.2 lib/chef/platform/resource_priority_map.rb
chef-12.4.0.rc.2-universal-mingw32 lib/chef/platform/resource_priority_map.rb