Class: CGI

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CGI.



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

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



16
17
18
# File 'lib/webrick_server.rb', line 16

def env_table
  @env_table || ENV
end

#stdinputObject



12
13
14
# File 'lib/webrick_server.rb', line 12

def stdinput
  @stdin || $stdin
end