Class: CGI

Inherits:
Object show all
Defined in:
lib/webrick_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(type = "query", table = nil, stdin = nil) ⇒ CGI

Returns a new instance of CGI.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/webrick_server.rb', line 22

def initialize(type = "query", table = nil, stdin = nil)
  @env_table, @stdin = table, stdin

  if defined?(MOD_RUBY) && !ENV.key?("GATEWAY_INTERFACE")
    Apache.request.setup_cgi_env
  end

  extend QueryExtension
  @multipart = false
  if defined?(CGI_PARAMS)
    warn "do not use CGI_PARAMS and CGI_COOKIES"
    @params = CGI_PARAMS.dup
    @cookies = CGI_COOKIES.dup
  else
    initialize_query()  # set @params, @cookies
  end
  @output_cookies = nil
  @output_hidden = nil
end

Instance Method Details

#env_tableObject



18
19
20
# File 'lib/webrick_server.rb', line 18

def env_table
  @env_table || ENV
end

#stdinputObject



14
15
16
# File 'lib/webrick_server.rb', line 14

def stdinput
  @stdin || $stdin
end