def answer_for(options, q, default = nil)
      case @format
      when :bash
        answer = DEFAULT_ANSWERS[q]
        answers = options[:answers]
      when :hiera
        answer = DEFAULT_HIERA_ANSWERS[q]
        answers = flatten_keys_to_joined_string(options[:answers]) if options[:answers]
      else
        raise NotImplementedError, "Don't know how to determine answers for #{@format}"
      end

      # check to see if there is a value for this in the provided options
      if answers && answers[q]
        answer = answers[q]
      end
      # use the default if we don't have anything
      if not answer
        answer = default
      end
      answer
    end
def answer_for(options, q, default = nil)
      case @format
      when :bash
        answer = DEFAULT_ANSWERS[q]
        answers = options[:answers]
      when :hiera
        answer = DEFAULT_HIERA_ANSWERS[q]
        answers = flatten_keys_to_joined_string(options[:answers]) if options[:answers]
      else
        raise NotImplementedError, "Don't know how to determine answers for #{@format}"
      end

      # check to see if there is a value for this in the provided options
      if answers && answers[q]
        answer = answers[q]
      end
      # use the default if we don't have anything
      if not answer
        answer = default
      end
      answer
    end
The answer value for a provided question.  Use the user answer when
 available, otherwise return the default.

 @param [Hash] options options for answer file
 @option options [Symbol] :answers Contains a hash of user provided
   question name and answer value pairs.
 @param [String] default Should there be no user value for the provided
   question name return this default
 @return [String] The answer value