def values_to_hash(values, file)
      @hash = {}
      values.each do |key, value|
        unless KEYS.include?(key)
          fail "Unrecognized key #{key} for #{feature}, #{name} in #{file}"
        end
        case key
        when 'auto_default'
          @auto_default = value ? true : false
        when 'data_format', 'get_data_format', 'set_data_format'
          @hash[key] = value.to_sym
        when 'default_only'
          @default_only = true
          # default_value overrides default_only
          @hash['default_value'] ||= value
        when 'multiple'
          @multiple = boolean_default_true(value)
        when 'kind'
          fail "Unknown 'kind': '#{value}'" unless KINDS.include?(value)
          @kind = value.to_sym
        when 'os_version'
          @os_version = value
        else
          # default_value overrides default_only
          @default_only = false if key == 'default_value'
          @hash[key] = value
        end
      end

      # Inherit general to specific if needed
      if @hash.key?('data_format')
        @hash['get_data_format'] = @hash['data_format'] \
          unless @hash.key?('get_data_format')
        @hash['set_data_format'] = @hash['data_format'] \
          unless @hash.key?('set_data_format')
      end
      if @hash.key?('context')
        @hash['get_context'] = @hash['context'] unless @hash.key?('get_context')
        @hash['set_context'] = @hash['context'] unless @hash.key?('set_context')
      end
      if @hash.key?('value')
        @hash['get_value'] = @hash['value'] unless @hash.key?('get_value')
        @hash['set_value'] = @hash['value'] unless @hash.key?('set_value')
      end

      @hash.delete_if { |key, _| key != 'default_value' } if @default_only
    end
def values_to_hash(values, file)
      @hash = {}
      values.each do |key, value|
        unless KEYS.include?(key)
          fail "Unrecognized key #{key} for #{feature}, #{name} in #{file}"
        end
        case key
        when 'auto_default'
          @auto_default = value ? true : false
        when 'data_format', 'get_data_format', 'set_data_format'
          @hash[key] = value.to_sym
        when 'default_only'
          @default_only = true
          # default_value overrides default_only
          @hash['default_value'] ||= value
        when 'multiple'
          @multiple = boolean_default_true(value)
        when 'kind'
          fail "Unknown 'kind': '#{value}'" unless KINDS.include?(value)
          @kind = value.to_sym
        when 'os_version'
          @os_version = value
        else
          # default_value overrides default_only
          @default_only = false if key == 'default_value'
          @hash[key] = value
        end
      end

      # Inherit general to specific if needed
      if @hash.key?('data_format')
        @hash['get_data_format'] = @hash['data_format'] \
          unless @hash.key?('get_data_format')
        @hash['set_data_format'] = @hash['data_format'] \
          unless @hash.key?('set_data_format')
      end
      if @hash.key?('context')
        @hash['get_context'] = @hash['context'] unless @hash.key?('get_context')
        @hash['set_context'] = @hash['context'] unless @hash.key?('set_context')
      end
      if @hash.key?('value')
        @hash['get_value'] = @hash['value'] unless @hash.key?('get_value')
        @hash['set_value'] = @hash['value'] unless @hash.key?('set_value')
      end

      @hash.delete_if { |key, _| key != 'default_value' } if @default_only
    end
Construct a CmdRef describing the given (feature, name) pair.
 Param "values" is a hash with keys as described in KEYS.
 Param "file" is for debugging purposes only.