def apply(values=nil)
      (values || {}).each do |name, value|
        if has_namespace?(name)
          # recursively apply namespace values if hash given; ignore otherwise.
          get_namespace(name).apply(value) if value.kind_of?(Hash)
        else
          # this is meant as a "value importer", so always apply distinct values
          # to prevent unintentional pass-by-ref shared objects.
          # be sure to use the namespace's writer to write the option value
          @ns.send("#{name}=", NsOptions.distinct_value(value))
        end
      end
    end
def apply(values=nil)
      (values || {}).each do |name, value|
        if has_namespace?(name)
          # recursively apply namespace values if hash given; ignore otherwise.
          get_namespace(name).apply(value) if value.kind_of?(Hash)
        else
          # this is meant as a "value importer", so always apply distinct values
          # to prevent unintentional pass-by-ref shared objects.
          # be sure to use the namespace's writer to write the option value
          @ns.send("#{name}=", NsOptions.distinct_value(value))
        end
      end
    end
The opposite of #to_hash. Takes a hash representation of options and
 namespaces and mass assigns option values.