Method: RestClient::ParamsArray#initialize

Defined in:
lib/restclient/params_array.rb

#initialize(array) ⇒ ParamsArray

Returns a new instance of ParamsArray.

Examples:

>> ParamsArray.new([[:foo, 123], [:foo, 456], [:bar, 789]])
This will be encoded as "foo=123&foo=456&bar=789"
>> ParamsArray.new({foo: 123, bar: 456})
This is valid, but there's no reason not to just use the Hash directly
instead of a ParamsArray.

Parameters:

  • array (Array<Array>)

    An array of parameter key,value pairs. These pairs may be 2 element arrays [key, value] or single element hashes => value. They may also be single element arrays to represent a key with no value.



31
32
33
# File 'lib/restclient/params_array.rb', line 31

def initialize(array)
  @array = process_input(array)
end