    # File lib/facets/more/units.rb, line 634
        def load_yaml(file)
          return if @loaded_yaml.include? file
          data = YAML.load_file(file)
          @loaded_yaml << file
          old_service = Thread.current['current_currency_exchange_service']
          data.each do |r|
            rule = {}
            r.each_pair do |k, v|
              rule[k.to_sym] = v
            end
            case rule[:type]
            when 'import'
              load_yaml(File.join(Units::Config::DATADIR, rule[:file] + '.yaml'))
            when 'si'
              register_si_unit(rule[:name], rule)
            when 'unit'
              register_unit(rule[:name], rule)
            when 'length'
              register_length_unit(rule[:name], rule)
            when 'binary'
              register_binary_unit(rule[:name], rule)
            when 'currency'
              register_currency(rule[:name], Thread.current['current_currency_exchange_service'])
            when 'service'
              begin
                Thread.current['current_currency_exchange_service'] = Units::Converter::ExchangeRate.const_get(rule[:name])
              rescue NameError
                raise NameError, "Exchange service not found: #{rule[:name].to_s.dump}"
              end
            else
              raise "unknown rule type #{rule[:type].to_s.dump}"
            end
          end
          Thread.current['current_currency_exchange_service'] = old_service
          self
        end