# File lib/puppet/util/settings.rb, line 516
516:   def setdefaults(section, defs)
517:     section = section.to_sym
518:     call = []
519:     defs.each { |name, hash|
520:       if hash.is_a? Array
521:         unless hash.length == 2
522:           raise ArgumentError, "Defaults specified as an array must contain only the default value and the decription"
523:         end
524:         tmp = hash
525:         hash = {}
526:         [:default, :desc].zip(tmp).each { |p,v| hash[p] = v }
527:       end
528:       name = name.to_sym
529:       hash[:name] = name
530:       hash[:section] = section
531:       raise ArgumentError, "Parameter #{name} is already defined" if @config.include?(name)
532:       tryconfig = newsetting(hash)
533:       if short = tryconfig.short
534:         if other = @shortnames[short]
535:           raise ArgumentError, "Parameter #{other.name} is already using short name '#{short}'"
536:         end
537:         @shortnames[short] = tryconfig
538:       end
539:       @config[name] = tryconfig
540: 
541:       # Collect the settings that need to have their hooks called immediately.
542:       # We have to collect them so that we can be sure we're fully initialized before
543:       # the hook is called.
544:       call << tryconfig if tryconfig.call_on_define
545:     }
546: 
547:     call.each { |setting| setting.handle(self.value(setting.name)) }
548:   end