Return a Hash containing all variables in the VarSet.

 @since 1.8.0

 This method is not terribly efficient. It is intended to be used only by
 debugging code to dump out a VarSet's variables.

 @return [Hash] All variables in the VarSet.
177357
def to_h
      result = deep_dup(@my_vars)
      @coa_vars.reduce(result) do |result, coa_vars|
        coa_vars.each_pair do |key, value|
          unless result.include?(key)
            result[key] = deep_dup(value)
          end
        end
        result
      end
    end
1063580
def []( *key )
            if Hash === @value
                v = @value.detect { |k,| k.transform == key.first }
                v[1] if v
            elsif Array === @value
                @value.[]( *key )
            end
        end
1227491
def vars_by_configs
      vars = {}
      configs.each do |c|
        vars = c.values.map { |k, v| [k, c] }.to_h.merge(vars)
      end
      vars
    end
1057406
def each(&block)
      return @results.each(&block) if @results
      @results = []
      cur_v_i = Array.new(@data.keys.length, 0)
      keys = @data.keys.sort_by(&:to_s)
      result = {}
      keys.each do |key|
        result[key] = @data[key][0]
      end
      while true
        r = result.dup
        @results << r
        block.call(r) if block
        keys.each_with_index do |k, k_i|
          v_i = ((cur_v_i[k_i] = (1 + cur_v_i[k_i]) % @data[k].length))
          result[k] = @data[k][v_i]
          if v_i > 0 # Found next ?
            break
          elsif k_i == keys.length - 1 # Last?
            return
          end
        end
      end
      @results
    end
1154219
def options
      map = Config.class_variables.map do |key|
        [key.to_s.tr('@', '').to_sym, class_variable_get(:"#{key}")]
      end
      Hash[map]
    end
629825
def all_settings
      settings = {}
      instance_variables.each do |var|
        key = var[1..-1]
        settings[key] = self.instance_variable_get(var)
      end
      settings
    end
1177513
private VarDef getNextVarDef()
    {
    if( nextVarDef_ == null)
      {
      // Still traversing current VarSet?
      if( nextVarSet_ != null && nextVarSet_.hasNext())
        {
        // Yes, return next VarSet member.
        nextVarDef_ = nextVarSet_.next();
        }
      else
        {
        // No, get next variable, skipping any empty VarSet.
        nextVarSet_ = null;
        Iterator<IVarDef> members = null;
        IVarDef varDef;
        for( varDef = null;

             varDefs_.hasNext()
               && (members = (varDef = varDefs_.next()).getMembers()) != null
               && !members.hasNext();

             varDef = null);

        nextVarDef_ =
          // No VarDef left to visit?
          varDef == null? null :

          // Next variable is a VarDef?
          members == null? (VarDef) varDef :

          // No, start traversing next VarSet.
          (nextVarSet_ = new VarDefIterator( members)).next();

        }
      }

    return nextVarDef_;
    }
940533
def all
      instance_variables.inject({}) do |h, v|
        var = v.to_s.sub('@', '')
        h.merge(var.to_sym => send(var))
      end
    end
1361860
def subst( hash )
      # subst_var = @index.subst hash
      # Lambda.new subst_var, @term.subst( @index => subst_var ).subst( hash )
      subst_var = @index.subst hash
      Lambda.new subst_var, @term.subst( hash.merge( @index => subst_var ) )
    end
596836
def to_hash
      hash = {}
      self.class.attribute_map.each_pair do |attr, param|
        value = self.send(attr)
        next if value.nil?
        hash[param] = _to_hash(value)
      end
      hash
    end
811284
def extract_variables(variable)
      return [variable] if variable.is_a? Hash
      return extract_variables_from_string(variable) if variable.is_a? String

      []
    end
741303
def set_env_vars(variables)
      save_vars = {}
      variables.each do |k, v|
        k = k.to_s
        save_vars[k] = ENV[k]
        ENV[k] = v.nil? ? v : v.to_s
      end
      begin
        yield
      ensure
        variables.each_key do |k|
          k = k.to_s
          ENV[k] = save_vars[k]
        end
      end
      true
    end
237926
def [](attr)
      return nil unless instance_variable_defined?(:@attributes) and @attributes.is_a?(Hash)
      @attributes[attr] or (attr.is_a?(String) ? @attributes[attr.to_sym] : @attributes[attr.to_s])
    end
733290
def build_environment_hash
      parsed_variables = {}
      @env.each do |env_row|
        # Each row can potentially contain multiple environment
        # variables
        variables = extract_variables(env_row)

        variables.each do |variables_with_values|
          variables_with_values.each do |key, value|
            parsed_variables[key] = value
          end
        end
      end

      @override_envs.each do |env|
        parsed_variables = parsed_variables.merge env
      end

      parsed_variables
    end
592302
def to_hash
      load

      {}.tap do |hash|
        @_definition.each do |k, v|
          hash[k] = v
        end
      end
    end
1130645
def attributes_hash
      attributes = @scope.attributes.collect do |attr|
        value = fetch_property(attr)

        if value.kind_of?(BigDecimal)
          value = value.to_f
        end

        [attr, value]
      end

      Hash[attributes]
    end
1125820
def to_hash
      _new_hash = ::Hash.new
      set_defaults(_new_hash)

      each do |key, value|
        _new_hash[key] = convert_value(value, for: :to_hash)
      end
      _new_hash
    end