def register_service(service, &block)
      @service2factory[service] = block

      # Create a lazy-loader getter for the service
      unless self.respond_to? service
        self.class.send(:define_method, service) do
          @services[service] ||= @service2factory[service].call(@config[service.to_s] || {})
        end
      end
    end
def register_service(service, &block)
      @service2factory[service] = block

      # Create a lazy-loader getter for the service
      unless self.respond_to? service
        self.class.send(:define_method, service) do
          @services[service] ||= @service2factory[service].call(@config[service.to_s] || {})
        end
      end
    end
@param config [Hash]


 @param service [Symbol] The service's name.
 @param block [Proc<Hash> -> Object] Given a config, create a service object.