Class: RightSpeed::Handler::Client
- Inherits:
-
Object
- Object
- RightSpeed::Handler::Client
- Defined in:
- lib/right_speed/handler.rb
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#server_addr ⇒ Object
readonly
Returns the value of attribute server_addr.
-
#server_port ⇒ Object
readonly
Returns the value of attribute server_port.
Instance Method Summary collapse
-
#initialize(conn) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(conn) ⇒ Client
Returns a new instance of Client.
71 72 73 74 75 76 77 |
# File 'lib/right_speed/handler.rb', line 71 def initialize(conn) _, @port, _, @addr = conn.peeraddr _, @server_port, _, @server_addr = conn.addr if @server_addr == "::1" @server_addr = "localhost" end end |
Instance Attribute Details
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
69 70 71 |
# File 'lib/right_speed/handler.rb', line 69 def addr @addr end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
69 70 71 |
# File 'lib/right_speed/handler.rb', line 69 def port @port end |
#server_addr ⇒ Object (readonly)
Returns the value of attribute server_addr.
69 70 71 |
# File 'lib/right_speed/handler.rb', line 69 def server_addr @server_addr end |
#server_port ⇒ Object (readonly)
Returns the value of attribute server_port.
69 70 71 |
# File 'lib/right_speed/handler.rb', line 69 def server_port @server_port end |