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.



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

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



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

def env_table
  @env_table || ENV
end

#stdinputObject



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

def stdinput
  @stdin || $stdin
end