Class: KManager::Resources::ResourceDocumentFactory

Inherits:
Object
  • Object
show all
Extended by:
KLog::Logging
Defined in:
lib/k_manager/resources/resource_document_factory.rb

Overview

Create documents based on the target resource

This factory will lock the resource and then create new documents based on the content of the resource.

In the case of a ruby resource, this factory will evaluate the ruby code dynamically and any ruby file with standard document DSL’s will create additional documents using KManager::DocumentFactory

Class Method Summary collapse

Class Method Details

.create_documents(target_resource) ⇒ Object

Build 0-more documents and attach them to the resource.

The resource is stored in the KManager.current_resource context and wrapped by a Mutex so that any self registering documents can figure out which resource to register themselves against



22
23
24
25
26
# File 'lib/k_manager/resources/resource_document_factory.rb', line 22

def create_documents(target_resource)
  KManager.for_resource(target_resource) do |resource|
    process_resource(resource)
  end
end