Method: Chef::NodeMap#list

Defined in:
lib/chef/node_map.rb

#list(node, key) ⇒ Object

List all matches for the given node and key from the NodeMap, from most-recently added to oldest.

Parameters:

  • node (Chef::Node)

    The Chef::Node object for the run, or nil to ignore all filters.

  • key (Object)

    Key to look up

Returns:

  • (Object)

    Class



141
142
143
144
145
146
147
# File 'lib/chef/node_map.rb', line 141

def list(node, key)
  return [] unless map.key?(key)

  map[key].select do |matcher|
    node_matches?(node, matcher)
  end.map { |matcher| matcher[:klass] }
end