Parent

Included Modules

Picombo::Input

Provides access and XSS filtering to GET and POST input variables

Using Input

Public Instance Methods

get(key = nil, default = nil) click to toggle source

Retrieves a GET item by key. If the key doesn’t exist, return default Optionaly returns the entire GET hash if key is nil

    # File lib/classes/input.rb, line 22
22:         def get(key = nil, default = nil)
23:             return @req.GET() if key.nil?
24: 
25:             get = @req.GET()
26:             return get[key] if get.has_key?(key)
27: 
28:             default
29:         end
post(key = nil, default = nil) click to toggle source

Retrieves a POST item by key. If the key doesn’t exist, return default Optionaly returns the entire POST hash if key is nil

    # File lib/classes/input.rb, line 43
43:         def post(key = nil, default = nil)
44:             return @req.POST() if key.nil?
45: 
46:             post = @req.POST()
47:             return post[key] if post.has_key?(key)
48: 
49:             default
50:         end
query_string(hash) click to toggle source
    # File lib/classes/input.rb, line 31
31:         def query_string(hash)
32:             temp = []
33: 
34:             hash.each do |key, value|
35:                 temp << key+'='+value
36:             end
37: 
38:             temp.join('&')
39:         end
set_request(req) click to toggle source

Sets the input request

    # File lib/classes/input.rb, line 14
14:         def set_request(req)
15:             @req = req
16: 
17:             Picombo::Log.write(:debug, 'Input Library initialized')
18:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.