Class: Kaya::Support::Request
- Inherits:
-
Object
- Object
- Kaya::Support::Request
show all
- Defined in:
- lib/kaya/support/request.rb
Instance Method Summary
collapse
Constructor Details
#initialize(req) ⇒ Request
Returns a new instance of Request.
5
6
7
|
# File 'lib/kaya/support/request.rb', line 5
def initialize req
@req = req
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/kaya/support/request.rb', line 25
def method_missing(method_name, *args, &block)
begin
send("@req.#{method_name}", *args)
rescue
$K_LOG.error "#{method_name} not found for req in #{self.class}. Returning nil"
nil
end
end
|
Instance Method Details
#ip ⇒ Object
17
18
19
|
# File 'lib/kaya/support/request.rb', line 17
def ip
@req.env["REMOTE_ADDR"]
end
|
#path ⇒ Object
9
10
11
|
# File 'lib/kaya/support/request.rb', line 9
def path
self.path_info
end
|
#path_info ⇒ Object
13
14
15
|
# File 'lib/kaya/support/request.rb', line 13
def path_info
@req.env["PATH_INFO"]
end
|
#x_uow ⇒ Object
21
22
23
|
# File 'lib/kaya/support/request.rb', line 21
def x_uow
@req.env["HTTP_X_UOW"]
end
|