Method: ChefAPI::Resource::CollectionProxy#each

Defined in:
lib/chef-api/resources/collection_proxy.rb

#each(&block) ⇒ Object

The custom iterator for looping over each object in this collection. For more information, please see the Enumerator module in Ruby core.



100
101
102
103
104
105
# File 'lib/chef-api/resources/collection_proxy.rb', line 100

def each(&block)
  collection.each do |id, url|
    object = cached(id) { klass.from_url(url, prefix) }
    block.call(object) if block
  end
end