Class: RestClient::ParamsArray
- Inherits:
-
Object
- Object
- RestClient::ParamsArray
- Includes:
- Enumerable
- Defined in:
- lib/restclient/params_array.rb
Overview
The ParamsArray class is used to represent an ordered list of [key, value] pairs. Use this when you need to include a key multiple times or want explicit control over parameter ordering.
Most of the request payload & parameter functions normally accept a Hash of keys => values, which does not allow for duplicated keys.
Instance Method Summary collapse
- #each(*args, &blk) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(array) ⇒ ParamsArray
constructor
A new instance of ParamsArray.
Constructor Details
#initialize(array) ⇒ ParamsArray
Returns a new instance of ParamsArray.
31 32 33 |
# File 'lib/restclient/params_array.rb', line 31 def initialize(array) @array = process_input(array) end |
Instance Method Details
#each(*args, &blk) ⇒ Object
35 36 37 |
# File 'lib/restclient/params_array.rb', line 35 def each(*args, &blk) @array.each(*args, &blk) end |
#empty? ⇒ Boolean
39 40 41 |
# File 'lib/restclient/params_array.rb', line 39 def empty? @array.empty? end |