def sanitize_request_parameters(parameters)
      parameters.reduce({}) do |result, (key, value)|
        # if the parameter is an array that contains non-enumerable values,
        # turn it into a comma-separated list
        # in Ruby 1.8.7, strings are enumerable, but we don't care
        if value.is_a?(Array) && value.none? {|entry| entry.is_a?(Enumerable) && !entry.is_a?(String)}
          value = value.join(",")
        end
        value = value.to_time if value.is_a? DateTime
        value = value.to_i if value.is_a? Time

        result.merge(key => value)
      end
    end
def sanitize_request_parameters(parameters)
      parameters.reduce({}) do |result, (key, value)|
        # if the parameter is an array that contains non-enumerable values,
        # turn it into a comma-separated list
        # in Ruby 1.8.7, strings are enumerable, but we don't care
        if value.is_a?(Array) && value.none? {|entry| entry.is_a?(Enumerable) && !entry.is_a?(String)}
          value = value.join(",")
        end
        value = value.to_time if value.is_a? DateTime
        value = value.to_i if value.is_a? Time

        result.merge(key => value)
      end
    end
Sanitizes Ruby objects into Strava-compatible string values.

 @param parameters a hash of parameters.

 Returns a hash in which values that are arrays of non-enumerable values
         (Strings, Symbols, Numbers, etc.) are turned into comma-separated strings.