Sha256: 651da2234866fff1748821968de5f245569ca6fbc3ad54362fe959a59a184467

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

Transform deeply nested param containers into a flat array of [key,
value] pairs.

*Examples:*

  >> flatten_params({key1: {key2: 123}})
  => [["key1[key2]", 123]]

  >> flatten_params({key1: {key2: 123, arr: [1,2,3]}})
  => [["key1[key2]", 123], ["key1[arr][]", 1], ["key1[arr][]", 2], ["key1[arr][]", 3]]

[Parameters:]

  - object (Hash, ParamsArray) -- The container to flatten
  - uri_escape (Boolean) -- Whether to URI escape keys and values
  - parent_key (String) -- Should not be passed (used for recursion)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rest-man-1.1.0 _doc/lib/restman/utils/flatten_params.rdoc