Class: FormParameters

Inherits:
Object
  • Object
show all
Defined in:
lib/foundation/FormParameters.rb

Instance Method Summary collapse

Constructor Details

#initializeFormParameters

Returns a new instance of FormParameters.



8
9
10
# File 'lib/foundation/FormParameters.rb', line 8

def initialize
  @parameterSet=Array.new()
end

Instance Method Details

#encodeParametersObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/foundation/FormParameters.rb', line 21

def encodeParameters
  rv=""
  i=0
  for fp in @parameterSet
    if (fp.getKey!=nil) && (fp.getValue!=nil)
      if i>0
        rv << "&"
      end
      rv << CGI::escape(fp.getKey.to_s)
      rv << '='
      rv << CGI::escape(fp.getValue.to_s)
      i=i+1
    end
  end
  return rv
end

#getParameterSetObject



17
18
19
# File 'lib/foundation/FormParameters.rb', line 17

def getParameterSet
  @parameterSet
end

#put(key, value) ⇒ Object



12
13
14
15
# File 'lib/foundation/FormParameters.rb', line 12

def put(key, value)
  fp=FormParameter.new(key, value)
  @parameterSet[@parameterSet.length]=fp
end