From 37a4a28deec224f7cd9a5a124e22258e868913e4 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Mon, 26 Nov 2012 21:40:21 +0100 Subject: added the first set of documentation --- doc/Zero/Request/Client.html | 579 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 579 insertions(+) create mode 100644 doc/Zero/Request/Client.html (limited to 'doc/Zero/Request/Client.html') diff --git a/doc/Zero/Request/Client.html b/doc/Zero/Request/Client.html new file mode 100644 index 0000000..f2e733d --- /dev/null +++ b/doc/Zero/Request/Client.html @@ -0,0 +1,579 @@ + + + + + + Class: Zero::Request::Client + + — Documentation by YARD 0.8.3 + + + + + + + + + + + + + + + + + + + + + +

Class: Zero::Request::Client + + + +

+ +
+ +
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+ + + + + + + + + +
Defined in:
+
lib/zero/request/client.rb
+ +
+
+ +

Overview

+
+ +

This class represents all information about the client of a request.

+ + +
+
+
+ + +
+

Constant Summary

+ +
+ +
KEY_REMOTE_ADDR = +
+
+ +

the key for the ip of the client

+ + +
+
+
+ + +
+
+
'REMOTE_ADDR'
+
+ +
KEY_REMOTE_HOST = +
+
+ +

the key for the hostname

+ + +
+
+
+ + +
+
+
'REMOTE_HOST'
+
+ +
KEY_USER_AGENT = +
+
+ +

the key for the user agent

+ + +
+
+
+ + +
+
+
'HTTP_USER_AGENT'
+
+ +
+ + + + + +

Instance Attribute Summary (collapse)

+ + + + + + +

+ Instance Method Summary + (collapse) +

+ + + + +
+

Constructor Details

+ +
+

+ + - (Client) initialize(environment) + + + + + +

+
+ +

creates a new client with the data of the request environment

+ + +
+
+
+

Parameters:

+
    + +
  • + + environment + + + + + + + — +
    +

    a hash representation of the request

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+14
+15
+16
+17
+18
+
+
# File 'lib/zero/request/client.rb', line 14
+
+def initialize(environment)
+  @address    = environment[KEY_REMOTE_ADDR]
+  @hostname   = environment[KEY_REMOTE_HOST]
+  @user_agent = environment[KEY_USER_AGENT]
+end
+
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + - (String) address (readonly) + + + + + +

+
+ +

the ip address of the client

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    the address of the client

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/zero/request/client.rb', line 22
+
+def address
+  @address
+end
+
+
+
+ + + +
+

+ + - (String) hostname (readonly) + + + + + +

+
+ +

the hostname of the client

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    the hostname of the client

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/zero/request/client.rb', line 25
+
+def hostname
+  @hostname
+end
+
+
+
+ + + +
+

+ + - (String) user_agent (readonly) + + + + + +

+
+ +

the user agent of the client

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +
    +

    the user agent of the client

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/zero/request/client.rb', line 28
+
+def user_agent
+  @user_agent
+end
+
+
+
+ +
+ + +
+ + + + + \ No newline at end of file -- cgit v1.2.3-70-g09d2