lib/puppet/indirector/request.rb
# Create the query string, if options are present.
Create the query string, if options are present.
Create the query string if options are present .
def query_string
    return "" unless options and ! options.empty?
    "?" + options.collect do |key, value|
      case value
      when nil; next
      when true, false; value = value.to_s
      when Fixnum, Bignum, Float; value = value 
      when String; value = CGI.escape(value)
      when Symbol; value = CGI.escape(value.to_s)
      when Array; value = CGI.escape(YAML.dump(value))
      else
        raise ArgumentError, "HTTP REST queries cannot handle values of type '#{value.class}'"
      end
      "#{key}=#{value}"
    end.join("&")
  end
def query_string return "" unless options and ! options . empty? "?" + options . collect do | key , value | case value when nil ; next when true , false ; value = value . to_s when Fixnum , Bignum , Float ; value = value when String ; value = CGI . escape ( value ) when Symbol ; value = CGI . escape ( value . to_s ) when Array ; value = CGI . escape ( YAML . dump ( value ) ) else raise ArgumentError , "HTTP REST queries cannot handle values of type '#{value.class}'" end "#{key}=#{value}" end . join ( "&" ) end
Create the query string, if options are present.
Create the query string if options are present .
# nothing