Class: Apache::Request
- Inherits:
-
ModRubySimObject
- Object
- ModRubySimObject
- Apache::Request
- Defined in:
- lib/apache/fakerequest.rb
Overview
Apache::Request
Constant Summary collapse
- 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 collapse
-
#allowed ⇒ Object
Returns the value of attribute allowed.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#cookies ⇒ Object
Returns the value of attribute cookies.
-
#headers_in ⇒ Object
Returns the value of attribute headers_in.
-
#headers_out ⇒ Object
Returns the value of attribute headers_out.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#method_number ⇒ Object
Returns the value of attribute method_number.
-
#options ⇒ Object
Returns the value of attribute options.
-
#paramtable ⇒ Object
(also: #params)
Returns the value of attribute paramtable.
-
#path_info ⇒ Object
Returns the value of attribute path_info.
- #server ⇒ Object
-
#sync_header ⇒ Object
Returns the value of attribute sync_header.
-
#uploads ⇒ Object
Returns the value of attribute uploads.
-
#uri ⇒ Object
(also: #unparsed_uri)
Returns the value of attribute uri.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(uri = nil) ⇒ Request
constructor
A new instance of Request.
- #param(key) ⇒ Object
- #remote_host(lookup = nil) ⇒ Object
- #request_method ⇒ Object
- #request_method=(methodname) ⇒ Object
- #status ⇒ Object
- #the_request ⇒ Object
Methods inherited from ModRubySimObject
Constructor Details
#initialize(uri = nil) ⇒ Request
Returns 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
#allowed ⇒ Object
Returns the value of attribute allowed.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def allowed @allowed end |
#connection ⇒ Object
Returns the value of attribute connection.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def connection @connection end |
#content_type ⇒ Object
Returns the value of attribute content_type.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def content_type @content_type end |
#cookies ⇒ Object
Returns the value of attribute cookies.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def @cookies end |
#headers_in ⇒ Object
Returns the value of attribute headers_in.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def headers_in @headers_in end |
#headers_out ⇒ Object
Returns the value of attribute headers_out.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def headers_out @headers_out end |
#hostname ⇒ Object
Returns the value of attribute hostname.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def hostname @hostname end |
#method_number ⇒ Object
Returns the value of attribute method_number.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def method_number @method_number end |
#options ⇒ Object
Returns the value of attribute options.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def @options end |
#paramtable ⇒ Object Also known as: params
Returns the value of attribute paramtable.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def paramtable @paramtable end |
#path_info ⇒ Object
Returns the value of attribute path_info.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def path_info @path_info end |
#server ⇒ Object
370 371 372 |
# File 'lib/apache/fakerequest.rb', line 370 def server @server ||= Apache::Server.new end |
#sync_header ⇒ Object
Returns the value of attribute sync_header.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def sync_header @sync_header end |
#uploads ⇒ Object
Returns the value of attribute uploads.
348 349 350 |
# File 'lib/apache/fakerequest.rb', line 348 def uploads @uploads end |
#uri ⇒ Object 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
.instance_methods(include_superclass = true) ⇒ Object
325 326 327 |
# File 'lib/apache/fakerequest.rb', line 325 def self::instance_methods( include_superclass=true ) return INSTANCE_METHODS end |
Instance Method Details
#param(key) ⇒ Object
361 362 363 |
# File 'lib/apache/fakerequest.rb', line 361 def param( key ) @paramtable[ key ] end |
#remote_host(lookup = nil) ⇒ Object
383 384 385 |
# File 'lib/apache/fakerequest.rb', line 383 def remote_host( lookup=nil ) return '127.0.0.1' end |
#request_method ⇒ Object
374 375 376 |
# File 'lib/apache/fakerequest.rb', line 374 def request_method return Apache::METHOD_NUMBERS_TO_NAMES[ @method_number ] end |
#request_method=(methodname) ⇒ Object
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 |
#status ⇒ Object
391 392 393 |
# File 'lib/apache/fakerequest.rb', line 391 def status return Apache::OK end |
#the_request ⇒ Object
387 388 389 |
# File 'lib/apache/fakerequest.rb', line 387 def the_request return 'GET / HTTP/1.1' end |