Class: Rack::Multipart::ParamList

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/multipart.rb

Overview

Accumulator for multipart form data, conforming to the QueryParser API. In future, the Parser could return the pair list directly, but that would change its API.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParamList

Returns a new instance of ParamList.



34
35
36
# File 'lib/rack/multipart.rb', line 34

def initialize
  @pairs = []
end

Class Method Details

.make_paramsObject

:nodoc:



26
27
28
# File 'lib/rack/multipart.rb', line 26

def self.make_params
  new
end

.normalize_params(params, key, value) ⇒ Object



30
31
32
# File 'lib/rack/multipart.rb', line 30

def self.normalize_params(params, key, value)
  params << [key, value]
end

Instance Method Details

#<<(pair) ⇒ Object



38
39
40
# File 'lib/rack/multipart.rb', line 38

def <<(pair)
  @pairs << pair
end

#to_params_hashObject



42
43
44
# File 'lib/rack/multipart.rb', line 42

def to_params_hash
  @pairs
end