Class: Apache::Request

Inherits:
ModRubySimObject show all
Defined in:
lib/apache/fakerequest.rb

Overview

Apache::Request

Constant Summary

INSTANCE_METHODS =
%w{
  << add_cgi_vars add_common_vars all_params allow_options
        allow_overrides allowed allowed= args args= attributes auth_name
        auth_name= auth_type auth_type= binmode bytes_sent cache_resp
        cache_resp= cancel connection construct_url content_encoding
        content_encoding= content_languages content_languages=
        content_length content_type content_type= cookies cookies=
        custom_response default_charset default_type disable_uploads=
        disable_uploads? dispatch_handler dispatch_handler= eof eof?
        err_headers_out error_message escape_html exception filename
        filename= finfo get_basic_auth_pw get_client_block getc
        hard_timeout header_only? headers_in headers_out hostname
        initial? internal_redirect kill_timeout last log_reason
        lookup_file lookup_uri main main? method_number next
        note_auth_failure note_basic_auth_failure
        note_digest_auth_failure notes options output_buffer param
        params params_as_string paramtable parse path_info path_info=
        post_max post_max= prev print printf protocol proxy? proxy_pass?
        putc puts read register_cleanup remote_host remote_logname
        replace request_method request_time requires reset_timeout
        satisfies script_name script_path send_fd send_http_header
        sent_http_header? server server_name server_port setup_cgi_env
        setup_client_block should_client_block should_client_block?
        signature soft_timeout status status= status_line status_line=
        subprocess_env sync= sync_header sync_header= sync_output
        sync_output= temp_dir temp_dir= the_request unparsed_uri
        upload_hook upload_hook= upload_hook_data upload_hook_data=
        uploads uploads_disabled? uri uri= user user= write
}

Instance Attribute Summary

Class Method Summary

Instance Method Summary

Constructor Details

- (Request) initialize(uri = nil)

A new instance of Request



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/apache/fakerequest.rb', line 330

def initialize( uri=nil )
  @uri = uri
  @server = nil
  @allowed = Apache::M_GET | Apache::M_POST
  @paramtable = {}
  @sync_header = false
  @content_type = 'text/html'
  @hostname = 'localhost'
  @path_info = ''
  @headers_in = Apache::Table.new
  @headers_out = Apache::Table.new
  @options = {}
  @uploads = {}
  @method_number = Apache::M_GET
  @connection = Apache::Connection.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Apache::ModRubySimObject

Instance Attribute Details

- (Object) allowed

Returns the value of attribute allowed



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def allowed
  @allowed
end

- (Object) connection

Returns the value of attribute connection



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def connection
  @connection
end

- (Object) content_type

Returns the value of attribute content_type



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def content_type
  @content_type
end

- (Object) cookies

Returns the value of attribute cookies



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def cookies
  @cookies
end

- (Object) headers_in

Returns the value of attribute headers_in



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def headers_in
  @headers_in
end

- (Object) headers_out

Returns the value of attribute headers_out



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def headers_out
  @headers_out
end

- (Object) hostname

Returns the value of attribute hostname



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def hostname
  @hostname
end

- (Object) method_number

Returns the value of attribute method_number



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def method_number
  @method_number
end

- (Object) options

Returns the value of attribute options



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def options
  @options
end

- (Object) paramtable Also known as: params

Returns the value of attribute paramtable



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def paramtable
  @paramtable
end

- (Object) path_info

Returns the value of attribute path_info



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def path_info
  @path_info
end

- (Object) server



370
371
372
# File 'lib/apache/fakerequest.rb', line 370

def server
  @server ||= Apache::Server.new
end

- (Object) sync_header

Returns the value of attribute sync_header



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def sync_header
  @sync_header
end

- (Object) uploads

Returns the value of attribute uploads



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def uploads
  @uploads
end

- (Object) uri Also known as: unparsed_uri

Returns the value of attribute uri



348
349
350
# File 'lib/apache/fakerequest.rb', line 348

def uri
  @uri
end

Class Method Details

+ (Object) instance_methods(include_superclass = true)



325
326
327
# File 'lib/apache/fakerequest.rb', line 325

def self::instance_methods( include_superclass=true )
  return INSTANCE_METHODS
end

Instance Method Details

- (Object) param(key)



361
362
363
# File 'lib/apache/fakerequest.rb', line 361

def param( key )
  @paramtable[ key ]
end

- (Object) remote_host(lookup = nil)



383
384
385
# File 'lib/apache/fakerequest.rb', line 383

def remote_host( lookup=nil )
  return '127.0.0.1'
end

- (Object) request_method



374
375
376
# File 'lib/apache/fakerequest.rb', line 374

def request_method
  return Apache::METHOD_NUMBERS_TO_NAMES[ @method_number ]
end

- (Object) request_method=(methodname)



378
379
380
381
# File 'lib/apache/fakerequest.rb', line 378

def request_method=( methodname )
  @method_number = Apache::METHOD_NAMES_TO_NUMBERS[ methodname ] or
    raise "No such HTTP method '%s'" % [methodname]
end

- (Object) status



391
392
393
# File 'lib/apache/fakerequest.rb', line 391

def status
  return Apache::OK
end

- (Object) the_request



387
388
389
# File 'lib/apache/fakerequest.rb', line 387

def the_request
  return 'GET / HTTP/1.1'
end