This delegate is responsible for processing a package descriptor into a Registry instance.

Methods
Constants
VALID_KEYS = [ "id", "description", "service-points", "configuration-points", "contributions", "require" ]
  The list of recognized key values in a package descriptor.
REQUIRED_KEYS = [ "id" ]
  The list of required key values in a package descriptor.
Included Modules
Public Class methods
new( registry, loader )

Creates a new PackageProcessor that feeds into the given Registry instance.

    # File lib/copland/configuration/yaml/package.rb, line 51
51:         def initialize( registry, loader )
52:           @registry = registry
53:           @loader = loader
54:         end
Public Instance methods
process( doc, options={} )

Process the package descriptor doc into the active Registry instance. The options parameter is used when processing service and configuration points within this package descriptor. The new Package instance is added directly to the registry.

     # File lib/copland/configuration/yaml/package.rb, line 67
 67:         def process( doc, options={} )
 68:           ensure_element_type "package definition", doc, Hash
 69:           validate_elements doc
 70: 
 71:           package = Package.new( @registry, doc["id"] )
 72:           @registry.add_package package
 73: 
 74:           doc.each_pair do |key, value|
 75:             case key
 76:               when "id"
 77:                 # already discovered and handled above
 78: 
 79:               when "description"
 80:                 package.description = value
 81: 
 82:               when "service-points"
 83:                 ensure_element_type "service-points", value, Hash
 84:                 processor = ServicePointProcessor.new( package, options )
 85: 
 86:                 value.each_pair do |name, definition|
 87:                   point = processor.process name, definition
 88:                   package.add_service_point point
 89:                 end
 90: 
 91:               when "configuration-points"
 92:                 ensure_element_type "configuration-points", value, Hash
 93:                 processor = ConfigurationPointProcessor.new( package, options )
 94: 
 95:                 value.each_pair do |name, definition|
 96:                   point = processor.process name, definition
 97:                   package.add_configuration_point point
 98:                 end
 99: 
100:               when "contributions"
101:                 ensure_element_type "contributions", value, Hash
102: 
103:                 value.each_pair do |name, value|
104:                   package.add_pending_contribution name, value
105:                 end
106: 
107:               when "require"
108:                 ensure_element_type "require", value, Array
109:                 value.each do |name|
110:                   @loader.use_library name
111:                 end
112: 
113:               else
114:                 raise CoplandBug,
115:                   "[BUG] invalid element discovered too late:" +
116:                   key.inspect
117:             end
118:           end
119:         end